[Tinyos-devel] Latest Time Sync Protocol ported to TinyOS 2.x?
Miklos Maroti
mmaroti at math.u-szeged.hu
Tue Apr 22 04:03:10 PDT 2008
Hi Brano,
Any ideas what is going on with that time stamping code for the
CC2420? I never saw that relocation warning, and to be frank I have no
idea what that means. I have CC'd the tinyos-devel list, maybe someone
knows that.
On a somewhat related note, I really really would like to make the
access functions in the Packet interface to be asynchronous, otherwise
we are not going to be able to access the maxPayloadLength and
payloadLength of the message in asynchronous context. This is very
annoying and I cannot circumvent it without duplicated code.
Miklos
2008/4/18 Phoebus W. Chen <phoebusc at eecs.berkeley.edu>:
> My mistake, Miklos. I should have done more troubleshooting before jumping
> to a conclusion. The offending line in TimeSyncMessageP.nc was not as I
> mentioned in my previous email's attached text file. I was able to
> eliminate the relocation error message by commenting out an access to
> msg->data in TimeSyncMessageP.nc:getLocal(), but of course that would lead
> to incorrect code. I'm not sure what's going on.
>
> Do you get the same relocation error message when you compile for the telosb
> platform? Can I ignore the message? The program does finish compilation
> (the relocation error is treated as a warning), and it runs on the motes,
> but the data looks incorrect. I've attached my data.out and *.report files
> if you are curious. I had to reset my TestTimeSyncPollerC mote once during
> the experiment because it froze (in fact, it froze again at the end of the
> experiment... not sure why).
>
> I've updated and attached the detailed description of the compilation
> problem in README_telosb_mods.txt .
>
> Phoebus
>
>
>
> Miklos Maroti wrote:
> > Hi Guys,
> >
> >
> > > would probably require a less trivial modification, so I've left it for
> > > Miklos and others to solve. Basically, I believe TimeSyncMessageP.nc is
> > > trying to access the metadata fields of a message_t buffer without using
> the
> > > accessor functions, as recommended in
> > > http://www.tinyos.net/tinyos-2.x/doc/html/tep111.html , and hence it may
> not
> > > access the packet fields correctly since they are not in contiguous
> memory.
> > >
> >
> > I think the code is correct. Here is the layout of a time sync message:
> >
> > [ header ] [ [ user data ] [ time offset ] unused [ event time] ] [
> metadata ]
> >
> > Where [ [ user data ] [ time offset ] unused [ event time] ] all fit
> > inside the message.data + footer field, and does not go into the
> > metadata. The length of this block is actually the maxPayloadLength()
> > of the encompassing Send implementation. The maxPayloadLength of time
> > synced messages is the encompassing maxPayloadLength minus the length
> > of the time offset and the event time. Only the user data and time
> > offset is transmitted over the air, and time offset is actually
> > calculated when the message is transmitted. Nothing is stored in the
> > metadata (actually something is stored: that this message need to be
> > timestamped just before it is transmitted).
> >
> > Does this make sense?
> >
> > Miklos
> >
>
> 2 38 3506686 3762486 0 0 1 6 7
> 1 39 3806192 3806192 0 0 1 7 0
> 2 39 3526996 3858320 0 0 1 6 7
> 1 40 3902531 3902531 0 0 1 8 0
> 2 40 4667411 3954660 1 0 1 7 1
> 1 41 3998323 3998323 0 0 1 8 0
> 2 41 4687712 4050452 1 0 1 7 1
> 1 42 4094564 4094564 0 0 1 8 0
> 2 42 4708109 4146693 1 0 1 7 1
> 1 43 4190545 4190545 0 0 1 9 0
> 2 43 2155674521 4242675 1 1084210048 1 8 2
> 1 44 4286607 4286607 0 0 1 9 0
> 2 44 2155770583 4338737 1 1084210048 1 8 2
> 1 45 4382689 4382689 0 0 1 9 0
> 2 45 2155866666 4434820 1 1084210048 1 8 2
> 1 46 4478822 4478822 0 0 1 9 0
> 2 46 2155962800 4530954 1 1084210048 1 8 2
> 1 47 4574914 4574914 0 0 1 10 0
> 2 47 2156218890 4627045 1 3019438976 1 9 3
> 1 48 4670888 4670888 0 0 1 10 0
> 2 48 2156314865 4723020 1 3019438976 1 9 3
> 1 49 4767999 4767999 0 0 1 10 0
> 2 49 2156411977 4820132 1 3019438976 1 9 3
> 1 50 4864039 4864039 0 0 1 11 0
> 2 50 2156668018 4916172 0 398883008 1 10 4
> 1 51 4965539 4965539 0 0 1 11 0
> 2 51 2156769518 5017672 0 398883008 1 10 4
> 1 52 5061532 5061532 0 0 1 11 0
> 2 52 2156865512 5113666 0 398883008 1 10 4
> 1 53 5445439 5445439 0 0 1 13 0
> 2 53 2157569418 5497574 0 4184915712 1 12 6
> 1 54 5541905 5541905 0 0 1 13 0
> 2 54 2157665885 5594041 0 4184915712 1 12 6
> 2 0 2242334981 47863328 0 1227046528 1 144 5
> 1 0 47811002 47811002 0 0 1 145 0
> 2 1 2242431086 47959433 0 1227046528 1 144 5
> 1 1 47907106 47907106 0 0 1 145 0
> 2 2 2242686953 48055300 0 811079232 1 145 6
> 1 2 48002973 48002973 0 0 1 146 0
> 2 3 2242783000 48151347 0 811079232 1 145 6
> 1 3 48099019 48099019 0 0 1 146 0
> 2 4 2242879091 48247438 0 811079232 1 145 6
> 1 4 48195110 48195110 0 0 1 146 0
> 2 5 2242975160 48343507 0 811079232 1 145 6
> 1 5 48291178 48291178 0 0 1 146 0
> 2 6 2243231061 48439409 0 1713079232 1 146 7
> 1 6 48387080 48387080 0 0 1 147 0
> 2 7 2243327091 48535439 0 1713079232 1 146 7
> 1 7 48483110 48483110 0 0 1 147 0
> 2 8 2243423162 48631510 0 1713079232 1 146 7
> 1 8 48579180 48579180 0 0 1 147 0
> 2 9 2244799219 48727575 1 1713079232 1 147 1
> 1 9 48675245 48675245 0 0 1 148 0
> 2 10 2244895264 48823620 1 1713079232 1 147 1
> 1 10 48771289 48771289 0 0 1 148 0
> 2 11 2244991317 48919673 1 1713079232 1 147 1
> 1 11 48867343 48867343 0 0 1 148 0
> 2 12 2245247347 49015703 1 1086210048 1 148 2
> 1 12 48963372 48963372 0 0 1 149 0
> 2 13 2245343330 49111686 1 1086210048 1 148 2
> 1 13 49059355 49059355 0 0 1 149 0
> 2 14 2245439451 49207807 1 1086210048 1 148 2
> 1 14 49155475 49155475 0 0 1 149 0
> 2 15 2245535558 49303914 1 1086210048 1 148 2
> 1 15 49251581 49251581 0 0 1 149 0
> 2 16 2245791590 49399946 1 3445948416 1 149 3
> 1 16 49347613 49347613 0 0 1 150 0
> 2 17 2245887607 49495963 1 3445948416 1 149 3
> 1 17 49443629 49443629 0 0 1 150 0
> 2 18 2245983752 49592108 1 3445948416 1 149 3
> 1 18 49539774 49539774 0 0 1 150 0
> 2 19 2246239769 49688126 0 1227046528 1 150 4
> 1 19 49635791 49635791 0 0 1 151 0
> 2 20 2246335727 49784084 0 1227046528 1 150 4
> 1 20 49731749 49731749 0 0 1 151 0
> 2 21 2246431672 49880029 0 1227046528 1 150 4
> 1 21 49827693 49827693 0 0 1 151 0
> 2 22 2246687706 49976063 0 1227046528 1 151 5
> 1 22 49923727 49923727 0 0 1 152 0
> 2 23 2246783790 50072147 0 1227046528 1 151 5
> 1 23 50019811 50019811 0 0 1 152 0
> 2 24 2246879794 50168151 0 1227046528 1 151 5
> 1 24 50115815 50115815 0 0 1 152 0
> 2 25 2246975950 50264307 0 1227046528 1 151 5
> 1 25 50211970 50211970 0 0 1 152 0
> 2 26 2247231984 50360341 0 811079232 1 152 6
> 1 26 50308004 50308004 0 0 1 153 0
> 2 27 2247327983 50456340 0 811079232 1 152 6
> 1 27 50404002 50404002 0 0 1 153 0
> 2 28 2247423980 50552337 0 811079232 1 152 6
> 1 28 50499999 50499999 0 0 1 153 0
> 2 29 2247680157 50648515 0 1713079232 1 153 7
> 1 29 50596176 50596176 0 0 1 154 0
> 2 30 2247776196 50744554 0 1713079232 1 153 7
> 1 30 50692215 50692215 0 0 1 154 0
> 2 31 2247872159 50840517 0 1713079232 1 153 7
> 1 31 50788177 50788177 0 0 1 154 0
> 2 32 2249248133 50936497 1 1713079232 1 154 1
> 1 32 50884157 50884157 0 0 1 155 0
> 2 33 2249344273 51032637 1 1713079232 1 154 1
> 1 33 50980297 50980297 0 0 1 155 0
> 2 34 2249440126 51128490 1 1713079232 1 154 1
> 1 34 51076150 51076150 0 0 1 155 0
> 2 35 2249536375 51224739 1 1713079232 1 154 1
> 1 35 51172398 51172398 0 0 1 155 0
> 2 36 2249792373 51320738 1 1084210048 1 155 2
> 1 36 51268397 51268397 0 0 1 156 0
> 2 37 2249888393 51416758 1 1084210048 1 155 2
> 1 37 51364416 51364416 0 0 1 156 0
> 2 38 2249984303 51512668 1 1084210048 1 155 2
> 1 38 51460326 51460326 0 0 1 156 0
> 2 39 2250240457 51608823 1 3019438976 1 156 3
> 1 39 51556480 51556480 0 0 1 157 0
> 2 40 2250336344 51704710 1 3019438976 1 156 3
> 1 40 51652367 51652367 0 0 1 157 0
> 2 41 2250432534 51800900 1 3019438976 1 156 3
> 1 41 51748556 51748556 0 0 1 157 0
> 2 42 2250688361 51896726 0 398883008 1 157 4
> 1 42 51844381 51844381 0 0 1 158 0
> 2 43 2250784692 51993057 0 398883008 1 157 4
> 1 43 51940713 51940713 0 0 1 158 0
> 2 44 2250880474 52088839 0 398883008 1 157 4
> 1 44 52036494 52036494 0 0 1 158 0
> 2 45 2250976708 52185073 0 398883008 1 157 4
> 1 45 52132728 52132728 0 0 1 158 0
> 2 46 2251232598 52280964 0 2816915712 1 158 5
> 1 46 52228618 52228618 0 0 1 159 0
> 2 47 2251328653 52377019 0 2816915712 1 158 5
> 1 47 52324673 52324673 0 0 1 159 0
> 2 48 2251424728 52473094 0 2816915712 1 158 5
> 1 48 52420747 52420747 0 0 1 159 0
> 2 49 2251680854 52569222 0 2058981120 1 159 6
> 1 49 52516875 52516875 0 0 1 160 0
> 2 50 2251776937 52665305 0 2058981120 1 159 6
> 1 50 52612957 52612957 0 0 1 160 0
> 2 51 2251872890 52761258 0 2058981120 1 159 6
> 1 51 52708911 52708911 0 0 1 160 0
> 2 52 2252128923 52857290 0 1255013824 1 160 7
> 1 52 52804942 52804942 0 0 1 161 0
> 2 53 2252224925 52953292 0 1255013824 1 160 7
> 1 53 52900944 52900944 0 0 1 161 0
> 2 54 2252320901 53049268 0 1255013824 1 160 7
> 1 54 52996919 52996919 0 0 1 161 0
> 2 55 2252417003 53145370 0 1255013824 1 160 7
> 1 55 53093020 53093020 0 0 1 161 0
> 2 56 2253793149 53241524 1 1255013824 1 161 1
> 1 56 53189174 53189174 0 0 1 162 0
> 2 57 2253888960 53337335 1 1255013824 1 161 1
> 1 57 53284984 53284984 0 0 1 162 0
> 2 58 2253985205 53433580 1 1255013824 1 161 1
> 1 58 53381229 53381229 0 0 1 162 0
> 2 59 2254241276 53529652 1 1085210048 1 162 2
> 1 59 53477300 53477300 0 0 1 163 0
> 2 60 2254337155 53625531 1 1085210048 1 162 2
> 1 60 53573179 53573179 0 0 1 163 0
> 2 61 2254433338 53721714 1 1085210048 1 162 2
> 1 61 53669362 53669362 0 0 1 163 0
> 2 62 2254689235 53817611 1 398883008 1 163 3
> 1 62 53765259 53765259 0 0 1 164 0
> 2 63 2254785384 53913760 1 398883008 1 163 3
> 1 63 53861407 53861407 0 0 1 164 0
> 2 64 2254881268 54009644 1 398883008 1 163 3
> 1 64 53957291 53957291 0 0 1 164 0
> 2 65 2254977425 54105801 1 398883008 1 163 3
> 1 65 54053447 54053447 0 0 1 164 0
> 2 66 2255233489 54201865 0 673981120 1 164 4
> 1 66 54149511 54149511 0 0 1 165 0
> 2 67 2255329544 54297920 0 673981120 1 164 4
> 1 67 54245565 54245565 0 0 1 165 0
> 2 68 2255425604 54393980 0 673981120 1 164 4
> 1 68 54341624 54341624 0 0 1 165 0
> 2 69 2255681421 54489797 0 189013824 1 165 5
> 1 69 54437441 54437441 0 0 1 166 0
> 2 70 2255777655 54586031 0 189013824 1 165 5
> 1 70 54533675 54533675 0 0 1 166 0
> 2 71 2255873769 54682145 0 189013824 1 165 5
> 1 71 54629789 54629789 0 0 1 166 0
> 2 72 2256129706 54778082 0 3563981120 1 166 6
> 1 72 54725725 54725725 0 0 1 167 0
> 2 73 2256225623 54873999 0 3563981120 1 166 6
> 1 73 54821642 54821642 0 0 1 167 0
> 2 74 2256321686 54970062 0 3563981120 1 166 6
> 1 74 54917704 54917704 0 0 1 167 0
> 2 75 2256417791 55066167 0 3563981120 1 166 6
> 1 75 55013809 55013809 0 0 1 167 0
> 2 76 2256673896 55162273 0 2508013824 1 167 7
> 1 76 55109914 55109914 0 0 1 168 0
> 2 77 2256770005 55258382 0 2508013824 1 167 7
> 1 77 55206023 55206023 0 0 1 168 0
> 2 78 2256865905 55354282 0 2508013824 1 167 7
> 1 78 55301923 55301923 0 0 1 168 0
> 2 79 2258241900 55450285 1 2508013824 1 168 1
> 1 79 55397926 55397926 0 0 1 169 0
> 2 80 2258338028 55546413 1 2508013824 1 168 1
> 1 80 55494053 55494053 0 0 1 169 0
> 2 81 2258434237 55642622 1 2508013824 1 168 1
> 1 81 55590261 55590261 0 0 1 169 0
> 2 82 2258690490 55738875 1 1085210048 1 169 2
> 1 82 55686514 55686514 0 0 1 170 0
> 2 83 2258821485 55869870 1 1085210048 1 169 2
> 1 83 55817508 55817508 0 0 1 170 0
> 2 84 2258917594 55965979 1 1085210048 1 169 2
> 1 84 55913617 55913617 0 0 1 170 0
> 2 85 2259871715 56600101 0 398883008 1 171 4
> 1 85 56547736 56547736 0 0 1 172 0
> 2 86 2260127901 56696288 0 2816915712 1 172 5
> 1 86 56643922 56643922 0 0 1 173 0
>
> 0.0000000e+00 1.0972620e+09 1.1450730e+09 2.0000000e+00
> 2.0000000e+00
> 1.0000000e+00 1.0972620e+09 1.1451691e+09 2.0000000e+00
> 2.0000000e+00
> 2.0000000e+00 1.0973420e+09 1.1453450e+09 2.0000000e+00
> 2.0000000e+00
> 3.0000000e+00 1.0973420e+09 1.1454410e+09 2.0000000e+00
> 2.0000000e+00
> 4.0000000e+00 1.0973420e+09 1.1455371e+09 2.0000000e+00
> 2.0000000e+00
> 5.0000000e+00 1.0973420e+09 1.1456332e+09 2.0000000e+00
> 2.0000000e+00
> 6.0000000e+00 1.0974220e+09 1.1458091e+09 2.0000000e+00
> 2.0000000e+00
> 7.0000000e+00 1.0974220e+09 1.1459051e+09 2.0000000e+00
> 2.0000000e+00
> 8.0000000e+00 1.0974220e+09 1.1460012e+09 2.0000000e+00
> 2.0000000e+00
> 9.0000000e+00 0.0000000e+00 4.8675245e+07 1.0000000e+00
> 2.0000000e+00
> 1.0000000e+01 0.0000000e+00 4.8771289e+07 1.0000000e+00
> 2.0000000e+00
> 1.1000000e+01 0.0000000e+00 4.8867343e+07 1.0000000e+00
> 2.0000000e+00
> 1.2000000e+01 0.0000000e+00 4.8963372e+07 1.0000000e+00
> 2.0000000e+00
> 1.3000000e+01 0.0000000e+00 4.9059355e+07 1.0000000e+00
> 2.0000000e+00
> 1.4000000e+01 0.0000000e+00 4.9155475e+07 1.0000000e+00
> 2.0000000e+00
> 1.5000000e+01 0.0000000e+00 4.9251581e+07 1.0000000e+00
> 2.0000000e+00
> 1.6000000e+01 0.0000000e+00 4.9347613e+07 1.0000000e+00
> 2.0000000e+00
> 1.7000000e+01 0.0000000e+00 4.9443629e+07 1.0000000e+00
> 2.0000000e+00
> 1.8000000e+01 0.0000000e+00 4.9539774e+07 1.0000000e+00
> 2.0000000e+00
> 1.9000000e+01 1.0983020e+09 1.1479378e+09 2.0000000e+00
> 2.0000000e+00
> 2.0000000e+01 1.0983020e+09 1.1480337e+09 2.0000000e+00
> 2.0000000e+00
> 2.1000000e+01 1.0983020e+09 1.1481297e+09 2.0000000e+00
> 2.0000000e+00
> 2.2000000e+01 1.0983820e+09 1.1483057e+09 2.0000000e+00
> 2.0000000e+00
> 2.3000000e+01 1.0983820e+09 1.1484018e+09 2.0000000e+00
> 2.0000000e+00
> 2.4000000e+01 1.0983820e+09 1.1484978e+09 2.0000000e+00
> 2.0000000e+00
> 2.5000000e+01 1.0983820e+09 1.1485940e+09 2.0000000e+00
> 2.0000000e+00
> 2.6000000e+01 1.0984620e+09 1.1487700e+09 2.0000000e+00
> 2.0000000e+00
> 2.7000000e+01 1.0984620e+09 1.1488660e+09 2.0000000e+00
> 2.0000000e+00
> 2.8000000e+01 1.0984620e+09 1.1489620e+09 2.0000000e+00
> 2.0000000e+00
> 2.9000000e+01 1.0985420e+09 1.1491382e+09 2.0000000e+00
> 2.0000000e+00
> 3.0000000e+01 1.0985420e+09 1.1492342e+09 2.0000000e+00
> 2.0000000e+00
> 3.1000000e+01 1.0985420e+09 1.1493302e+09 2.0000000e+00
> 2.0000000e+00
> 3.2000000e+01 0.0000000e+00 5.0884157e+07 1.0000000e+00
> 2.0000000e+00
> 3.3000000e+01 0.0000000e+00 5.0980297e+07 1.0000000e+00
> 2.0000000e+00
> 3.4000000e+01 0.0000000e+00 5.1076150e+07 1.0000000e+00
> 2.0000000e+00
> 3.5000000e+01 0.0000000e+00 5.1172398e+07 1.0000000e+00
> 2.0000000e+00
> 3.6000000e+01 0.0000000e+00 5.1268397e+07 1.0000000e+00
> 2.0000000e+00
> 3.7000000e+01 0.0000000e+00 5.1364416e+07 1.0000000e+00
> 2.0000000e+00
> 3.8000000e+01 2.3976820e+07 2.7483506e+07 2.0000000e+00
> 3.0000000e+00
> 3.9000000e+01 2.1284394e+07 1.9629889e+07 3.0000000e+00
> 4.0000000e+00
> 4.0000000e+01 2.3874918e+07 2.7777449e+07 2.0000000e+00
> 4.0000000e+00
> 4.1000000e+01 2.3875116e+07 2.7873440e+07 2.0000000e+00
> 4.0000000e+00
> 4.2000000e+01 9.8787506e+08 7.6887577e+08 3.0000000e+00
> 4.0000000e+00
> 4.3000000e+01 9.8787514e+08 7.6897198e+08 3.0000000e+00
> 4.0000000e+00
> 4.4000000e+01 9.8787508e+08 7.6906786e+08 3.0000000e+00
> 4.0000000e+00
> 4.5000000e+01 9.8787511e+08 7.6916404e+08 3.0000000e+00
> 4.0000000e+00
> 4.6000000e+01 9.8794617e+08 7.6931335e+08 3.0000000e+00
> 4.0000000e+00
> 4.7000000e+01 9.8794616e+08 7.6940941e+08 3.0000000e+00
> 4.0000000e+00
> 4.8000000e+01 9.8794618e+08 7.6950545e+08 3.0000000e+00
> 4.0000000e+00
> 4.9000000e+01 9.8801707e+08 7.6965524e+08 3.0000000e+00
> 4.0000000e+00
> 5.0000000e+01 1.0877420e+09 1.1164805e+09 4.0000000e+00
> 4.0000000e+00
> 5.1000000e+01 1.0877420e+09 1.1165792e+09 4.0000000e+00
> 4.0000000e+00
> 5.2000000e+01 1.0877820e+09 1.1167152e+09 4.0000000e+00
> 4.0000000e+00
> 5.3000000e+01 1.0878620e+09 1.1170352e+09 4.0000000e+00
> 4.0000000e+00
> 5.4000000e+01 1.0878620e+09 1.1171314e+09 4.0000000e+00
> 4.0000000e+00
> 5.5000000e+01 1.0996620e+09 1.1527550e+09 2.0000000e+00
> 2.0000000e+00
> 5.6000000e+01 0.0000000e+00 5.3189174e+07 1.0000000e+00
> 2.0000000e+00
> 5.7000000e+01 0.0000000e+00 5.3284984e+07 1.0000000e+00
> 2.0000000e+00
> 5.8000000e+01 0.0000000e+00 5.3381229e+07 1.0000000e+00
> 2.0000000e+00
> 5.9000000e+01 0.0000000e+00 5.3477300e+07 1.0000000e+00
> 2.0000000e+00
> 6.0000000e+01 0.0000000e+00 5.3573179e+07 1.0000000e+00
> 2.0000000e+00
> 6.1000000e+01 0.0000000e+00 5.3669362e+07 1.0000000e+00
> 2.0000000e+00
> 6.2000000e+01 0.0000000e+00 5.3765259e+07 1.0000000e+00
> 2.0000000e+00
> 6.3000000e+01 0.0000000e+00 5.3861407e+07 1.0000000e+00
> 2.0000000e+00
> 6.4000000e+01 0.0000000e+00 5.3957291e+07 1.0000000e+00
> 2.0000000e+00
> 6.5000000e+01 0.0000000e+00 5.4053447e+07 1.0000000e+00
> 2.0000000e+00
> 6.6000000e+01 1.1005420e+09 1.1546915e+09 2.0000000e+00
> 2.0000000e+00
> 6.7000000e+01 1.1005420e+09 1.1547876e+09 2.0000000e+00
> 2.0000000e+00
> 6.8000000e+01 1.1005420e+09 1.1548836e+09 2.0000000e+00
> 2.0000000e+00
> 6.9000000e+01 1.1006220e+09 1.1550594e+09 2.0000000e+00
> 2.0000000e+00
> 7.0000000e+01 1.1006220e+09 1.1551557e+09 2.0000000e+00
> 2.0000000e+00
> 7.1000000e+01 1.1006220e+09 1.1552518e+09 2.0000000e+00
> 2.0000000e+00
> 7.2000000e+01 1.1007020e+09 1.1554277e+09 2.0000000e+00
> 2.0000000e+00
> 7.3000000e+01 1.1007020e+09 1.1555236e+09 2.0000000e+00
> 2.0000000e+00
> 7.4000000e+01 1.1007020e+09 1.1556197e+09 2.0000000e+00
> 2.0000000e+00
> 7.5000000e+01 1.1007020e+09 1.1557158e+09 2.0000000e+00
> 2.0000000e+00
> 7.6000000e+01 1.1007820e+09 1.1558919e+09 2.0000000e+00
> 2.0000000e+00
> 7.7000000e+01 1.1007820e+09 1.1559880e+09 2.0000000e+00
> 2.0000000e+00
> 7.8000000e+01 1.1007820e+09 1.1560839e+09 2.0000000e+00
> 2.0000000e+00
> 7.9000000e+01 0.0000000e+00 5.5397926e+07 1.0000000e+00
> 2.0000000e+00
> 8.0000000e+01 0.0000000e+00 5.5494053e+07 1.0000000e+00
> 2.0000000e+00
> 8.1000000e+01 0.0000000e+00 5.5590261e+07 1.0000000e+00
> 2.0000000e+00
> 8.2000000e+01 0.0000000e+00 5.5686514e+07 1.0000000e+00
> 2.0000000e+00
> 8.3000000e+01 0.0000000e+00 5.5817508e+07 1.0000000e+00
> 2.0000000e+00
> 8.4000000e+01 0.0000000e+00 5.5913617e+07 1.0000000e+00
> 2.0000000e+00
> 8.5000000e+01 1.1016620e+09 1.1582097e+09 2.0000000e+00
> 2.0000000e+00
> 8.6000000e+01 1.1017420e+09 1.1583859e+09 2.0000000e+00
> 2.0000000e+00
>
> =========================================================
> Modifications for TinyOS 2.x FTSP compilation on TelosB
> =========================================================
>
> :Author: Phoebus Chen
> :Date: Thu Apr 17 15:32:56 PDT 2008
>
>
> The steps below pertain to the version of the repository checked out
> on Wed Apr 16 13:17:36 PDT 2008
>
> Follow the directions in the README files (setting environment
> variables, etc.).
>
> Root Directory: /opt/tinyos-2.x-contrib/stanford-lgl
> Application Directory: /opt/tinyos-2.x-contrib/stanford-lgl/apps/TestFTSP
>
>
>
> Modifications
> =============
>
> /opt/tinyos-2.x-contrib/stanford-lgl/apps/TestFTSP
> --------------------------------------------------
> 31c31
> < #TimeSyncMicroC as TimeSyncC, !!! doesn't work right
> now
> ---
> > TimeSyncMicroC as TimeSyncC, //!!! doesn't work right now
>
>
> /opt/tinyos-2.x-contrib/stanford-lgl/support/make/lgl.extra
> -----------------------------------------------------------
> Add these lines to the end of the file:
>
> ifeq ($(PLATFORM),telosb)
> # PFLAGS := -I$(LGLDIR)/tos/interfaces $(PFLAGS)
> # PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/timestamping $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/ $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/csma $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/interfaces $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/packet $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/receive $(PFLAGS)
> PFLAGS := -I$(LGLDIR)/tos/chips/cc2420/transmit $(PFLAGS)
> endif
>
>
> /opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP/TimeSyncM.nc
> -----------------------------------------------------------
> For some strange reason, we had to move a line for the program to
> compile properly for the TelosB platform. Perhaps there are other
> hidden bugs (such as the currently known error described below) that
> are causing this.
>
> 43d42
> < interface TimeSyncSend<T32khz> as Send;
> 48a48
> > interface TimeSyncSend<T32khz> as Send;
>
>
>
> Current Compilation Status
> ==========================
> bash-3.1$ pwd
> /opt/tinyos-2.x-contrib/stanford-lgl/apps/TestFTSP
>
> bash-3.1$ make telosb
> mkdir -p build/telosb
> compiling TestTimeSyncC to a telosb binary
> ncc -o build/telosb/main.exe -Os -O
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/transmit
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/receive
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/packet
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/interfaces
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/csma
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/ -mdisable-hwmul
> -DCC2420_DEF_CHANNEL=0x11 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x0a -Wnesc-all
> -target=telosb -fnesc-cfile=build/telosb/app.c -board= -DTIMESYNC_RATE=10
> -DTIMESYNC_POLLER_RATE=3 -I/opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP
> -DIDENT_PROGRAM_NAME=\"TestTimeSyncC\" -DIDENT_USER_ID=\"phoebusc\"
> -DIDENT_HOSTNAME=\"puccini.EECS.Be\" -DIDENT_USER_HASH=0x460e8238L
> -DIDENT_UNIX_TIME=0x4806a451L -DIDENT_UID_HASH=0xc0f7bfa6L TestTimeSyncC.nc
> -lm
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:157:
> warning: `SubPacket.payloadLength' called asynchronously from
> `PacketLastTouch.touch'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> /tmp/ccR4FHYE.o: In function `TimeSyncM$sendMsg$runTask':
> app.c:(.text+0x1e76): warning: internal error: unsupported relocation error
> app.c:(.text+0x1e7a): warning: internal error: unsupported relocation error
> compiled TestTimeSyncC to build/telosb/main.exe
> 17182 bytes in ROM
> 502 bytes in RAM
> msp430-objcopy --output-target=ihex build/telosb/main.exe
> build/telosb/main.ihex
> writing TOS image
>
> bash-3.1$ make micaz
> mkdir -p build/micaz
> compiling TestTimeSyncC to a micaz binary
> ncc -o build/micaz/main.exe -Os
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/transmit
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/receive
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/packet
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/interfaces
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/csma
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/
> -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz
> -fnesc-cfile=build/micaz/app.c -board=micasb -DTIMESYNC_RATE=10
> -DTIMESYNC_POLLER_RATE=3 -I/opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP
> -DIDENT_PROGRAM_NAME=\"TestTimeSyncC\" -DIDENT_USER_ID=\"phoebusc\"
> -DIDENT_HOSTNAME=\"puccini.EECS.Be\" -DIDENT_USER_HASH=0x460e8238L
> -DIDENT_UNIX_TIME=0x4806a56bL -DIDENT_UID_HASH=0xcda3ffc8L
> -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())'
> -fnesc-dump='referenced(interfacedefs, components)'
> -fnesc-dumpfile=build/micaz/wiring-check.xml TestTimeSyncC.nc -lm
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:157:
> warning: `SubPacket.payloadLength' called asynchronously from
> `PacketLastTouch.touch'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> compiled TestTimeSyncC to build/micaz/main.exe
> 18750 bytes in ROM
> 482 bytes in RAM
> avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec
> avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex
> writing TOS image
>
>
>
> Known Errors
> ============
> If we comment out line 352 in
> ``/opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP/TimeSyncM.nc``, the
> lines::
>
> else if( call Send.send(localTime,AM_BROADCAST_ADDR, &outgoingMsgBuffer,
> TIMESYNCMSG_LEN ) != SUCCESS ){
> state &= ~STATE_SENDING;
> signal TimeSyncNotify.msg_sent();
> }
>
> we do not get the relocation error noted above.
>
> bash-3.1$ pwd
> /opt/tinyos-2.x-contrib/stanford-lgl/apps/TestFTSP
>
> bash-3.1$ make telosb
> mkdir -p build/telosb
> compiling TestTimeSyncC to a telosb binary
> ncc -o build/telosb/main.exe -Os -O
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/transmit
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/receive
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/packet
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/interfaces
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/csma
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/ -mdisable-hwmul
> -DCC2420_DEF_CHANNEL=0x11 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x0a -Wnesc-all
> -target=telosb -fnesc-cfile=build/telosb/app.c -board= -DTIMESYNC_RATE=10
> -DTIMESYNC_POLLER_RATE=3 -I/opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP
> -DIDENT_PROGRAM_NAME=\"TestTimeSyncC\" -DIDENT_USER_ID=\"phoebusc\"
> -DIDENT_HOSTNAME=\"puccini.EECS.Be\" -DIDENT_USER_HASH=0x460e8238L
> -DIDENT_UNIX_TIME=0x4806a75fL -DIDENT_UID_HASH=0xe5c6296cL TestTimeSyncC.nc
> -lm
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:157:
> warning: `SubPacket.payloadLength' called asynchronously from
> `PacketLastTouch.touch'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> compiled TestTimeSyncC to build/telosb/main.exe
> 17124 bytes in ROM
> 502 bytes in RAM
> msp430-objcopy --output-target=ihex build/telosb/main.exe
> build/telosb/main.ihex
> writing TOS image
>
>
> After further exploration, we find that the offending command is::
>
> call Send.send(localTime,AM_BROADCAST_ADDR, &outgoingMsgBuffer,
> TIMESYNCMSG_LEN )
>
> particularly when ``Send.send()`` is passed the pointer
> ``&outgoingMsgBuffer``.
> ``Send.send()`` is wired to ``TimeSyncSend32khz.send[am_id_t id]()``
> in
> ``/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc``.
> We see on line 102 of ``TimeSyncMessageP.nc`` that there is a call::
>
> timesync_local_t* local = getLocal(msg);
>
> Which refers to line 66-69 of ``TimeSyncMessageP.nc``. Of particular
> note is ``msg->data`` in line 68::
>
> return (timesync_local_t*)(msg->data + call SubPacket.maxPayloadLength()
> - sizeof(timesync_local_t));
>
> If we comment out ``msg->data`` from this line, we do not get a
> relocation error message. Which suggests that something is wrong with
> ``msg`` to this function (``getLocal`` is used elsewhere in the code,
> particularly by ``PacketLastTouch.touch()`` in
> ``TimeSyncMessageP.nc``, without triggering a relocation error
> message.) But looking at TimeSyncM.nc, I was unable to see anything
> suspicious in the way ``outgoingMsgBuffer`` is allocated or used.
> Perhaps we can ignore this relocation error message (the compilation
> completes anyways)?
>
>
> Here is the output when we remove ``msg->data`` in
> TimeSyncMessageP.nc:getLocal()::
>
> bash-3.1$ make telosb
> mkdir -p build/telosb
> compiling TestTimeSyncC to a telosb binary
> ncc -o build/telosb/main.exe -Os -O
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/transmit
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/receive
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/packet
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/interfaces
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/csma
> -I/opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/ -mdisable-hwmul
> -DCC2420_DEF_CHANNEL=0x11 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x0a -Wnesc-all
> -target=telosb -fnesc-cfile=build/telosb/app.c -board= -DTIMESYNC_RATE=10
> -DTIMESYNC_POLLER_RATE=3 -I/opt/tinyos-2.x-contrib/stanford-lgl/libs/FTSP
> -DIDENT_PROGRAM_NAME=\"TestTimeSyncC\" -DIDENT_USER_ID=\"phoebusc\"
> -DIDENT_HOSTNAME=\"puccini.EECS.Be\" -DIDENT_USER_HASH=0x460e8238L
> -DIDENT_UNIX_TIME=0x4807ccf9L -DIDENT_UID_HASH=0x14684102L TestTimeSyncC.nc
> -lm
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:157:
> warning: `SubPacket.payloadLength' called asynchronously from
> `PacketLastTouch.touch'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:63:
> warning: `SubPacket.payloadLength' called asynchronously from `getFooter'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> /opt/tinyos-2.x-contrib/stanford-lgl/tos/chips/cc2420/TimeSyncMessageP.nc:68:
> warning: `SubPacket.maxPayloadLength' called asynchronously from `getLocal'
> compiled TestTimeSyncC to build/telosb/main.exe
> 17182 bytes in ROM
> 502 bytes in RAM
> msp430-objcopy --output-target=ihex build/telosb/main.exe
> build/telosb/main.ihex
> writing TOS image
>
>
More information about the Tinyos-devel
mailing list