[Tinyos-help] Bugs found in Deluge/TOSBoot

ZHANG Mingze zhangmi3 at comp.nus.edu.sg
Sun Dec 24 05:02:33 PST 2006


Hi all,

I was debugging Deluge on mica2dot for two days and finally found 
something wrong in Deluge/TOSBoot, hope anyone who has knowledge on this 
can confirm with me.

First, the Deluge/TOSBoot/build/mica2/main.ihex shipped in 1.1.15 rpm 
(both tinyos and linux) is alright, but 
Deluge/TOSBoot/build/mica2dot/main.ihex does not work.

Second, the Deluge/TOSBoot/TOSBootM.nc is not working for both mica2 & 
mica2dot (I am curious where the mica2/main.ihex comes from if this code 
is not working). I further debug into, and find this line is not working 
for mica2 and mica2dot,
             if (intAddr != TOSBOOT_END)
                   return ERROR;

the TOSBOOT_END is not defined anywhere for both mica2 and mica2dot. 
Actually the initial address of both mica2 and mica2dot is 0x0000,
(I can confirm this in the binary image written on External 
Flash, I have read them out and read line by line, the intial address 
is 0x0000. This image on External Flash is right because mica2/main.ihex 
shipped with the rpm is able to reprogram the image without any problem),
so here the program should be,

             if (intAddr != 0x0000)
                   return ERROR;

Then, the problem is still not solved, I use LED count to count that there 
are exactly 90 loops in the real programming code, each loop 256bytes 
of binary will be reprogrammed (except the last loop), the section length 
is 22982 for the BlinkDeluge application, 22982/256 is exactly 89.77 so I 
believe all codes from flash are correctly written to Program Flash. 
However, although the reprogramming succeeds, the reprogrammed program is 
not correct (for example for the BlinkApplication, the LED is not blinking 
after reprogram).

So I wonder where's anything else can be wrong in TOSBootM.nc. The thing 
I suspect is ProgramFlash.nc but I am not sure. Hope anyone can help out.

Really thanks for the patients to read through, and hope my findings can 
help somebody else who is also struggling here..

Anyway, is it possible that the Deluge team is able to provide me with the 
correct bootloader main.ihex for mica2dot too? If so, it will save  me a 
lot of time.

Regards,
Mingze


More information about the Tinyos-help mailing list