[Tinyos-devel] nesc.xml bitoffset error
David Gay
dgay42 at gmail.com
Wed Feb 6 13:36:09 PST 2008
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
More information about the Tinyos-devel
mailing list