[Tinyos-devel] nesc.xml bitoffset error

WenZhan Song wenzhan.song at gmail.com
Thu Feb 7 11:25:51 PST 2008


David,

Your suggestions can correct the XML bitoffset problem of non-packed
structure, but it does not solve the second problem:
http://sensorweb.vancouver.wsu.edu/wiki/index.php/Tips#Problem2:_If_not.2C_the_initial_values_are_even_set_to_the_wrong_addresse_in_memory

According to our test, without "structure_size_boundary=32", it works great
if we always define packed structure. With it, it even has problems with
"packed" structure.

WenZhan
On Feb 6, 2008 1:36 PM, David Gay <dgay42 at gmail.com> wrote:

> On Feb 5, 2008 9:38 AM, WenZhan Song <wenzhan.song at gmail.com> wrote:
> > x1 address = 5c006fe0
> > x2 address = 5c006fe4
> > The address difference is 4 bytes, that is 32 bits.
> >
> >
> > But in nesc.xml, it shows that:
> >      <field bit-offset="I:8" name="x2" ref="0x2aaaac3e9aa0" size="I:1">
> >        <type-tag alignment="I:1" size="I:1">
> >          <struct-ref name="tTestArray" ref="0x2aaaac3eded0" />
> >          <typename>
> >            <typedef-ref name="tTestArray" ref="0x2aaaac3ec928" />
> >          </typename>
> >        </type-tag>
> >      </field>
> >    </struct>
> >
> > The bit-offset of x2 shall be "I:32".  Could someone tell me how to fix
> it
> > ot which program generates the nesc.xml file?
>
> The .platform file for the imote2 is presumably broken (I can only
> find the 2.x file, so can't check the 1.x one, but the 2.x one is
> broken too): it needs to specify the "structure size boundary" value
> (which affects structure layout, hence field offsets). For the 2.x,
> that means replacing
>  $ENV{NESC_MACHINE} = "pointer=4,4 float=4,4 double=8,4
> long_double=8,4 short=2,2 int=4,4 long=4,4 long_long=8,4
> int1248_align=1,2,4,4 wchar_size_size=4,4
> char_wchar_signed=false,true";
>
> with
>
>  $ENV{NESC_MACHINE} = "structure_size_boundary=32, pointer=4,4
> float=4,4 double=8,4 long_double=8,4 short=2,2 int=4,4 long=4,4
> long_long=8,4 int1248_align=1,2,4,4 wchar_size_size=4,4
> char_wchar_signed=false,true";
>
> in the .platform file.
>
> David Gay
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080207/d11c66cb/attachment-0001.htm


More information about the Tinyos-devel mailing list