So the bootloader code is prepended to each mica download? Then you're theory about config bits is probably the OP's problem...and I never tried avr-objdump, handy tool... thx MS
Razvan Musaloiu-E. wrote: > Hi! > > On Sun, 12 Jul 2009, Michael Schippling wrote: > >> Ah, looks like I had ihex and srec reversed... >> I've managed to scrod up my mica dev system by >> overloading Boomerang and then Moteworks for >> other platforms so I couldn't try a compile >> to see what happens... >> >> Do you know of any doc on the actual TOS link and >> download process? or is the atmega boot loader page >> the best we can do? > > I haven't throughly check the wiki to see if this info is there but here > is what I know about micaz (from porting the tosboot to tinyos-2.x :P): > the interrupt vectors start from address 0x00000. The first is the reset > followed by everything else (page 60 from [1]). You can see this very > easy using the avr-objdump utility: > > $ avr-objdump -d build/micaz/main.exe | head > > build/micaz/main.exe: file format elf32-avr > > Disassembly of section .text: > > 00000000 <__vectors>: > 0: 0c 94 49 00 jmp 0x92 ; 0x92 <__init> > 4: 0c 94 68 00 jmp 0xd0 ; 0xd0 <__bad_interrupt> > 8: 0c 94 68 00 jmp 0xd0 ; 0xd0 <__bad_interrupt> > c: 0c 94 68 00 jmp 0xd0 ; 0xd0 <__bad_interrupt> > ... > > One important fuse for booting is BOOTRST (page 61 and also 276 from > [1]). When the fuse is unprogrammed (1) the reset vector is at 0x00000. > When it is programmed (0) the reset is moved to the Boot Reset Address. The > tosboot bootloader is using this mechanism to be the first one that > runs. :P More specifically, tosboot is located at 0x1F000 and BOOTRST is > used to make the reset start there. tosboot doesn't need any other > interrupt vectors so this is the only changed. The main applications > remains unchanged. > > I hope this helps. :-) > > [1] http://www.atmel.com/dyn/resources/prod_documents/doc2467.pdf > > All the best! > Razvan ME > >> Razvan Musaloiu-E. wrote: >>> Hi! >>> >>> On Sun, 12 Jul 2009, Michael Schippling wrote: >>> >>>> I think the srec file is an intermediate between .exe and .ihex. >>> >>> The ihex and srec are in fact equivalent. In the default >>> configuration for MIB510/MIB520 the uisp and the srec are used. >>> >>>> Examine the make output carefully and you may find the command >>>> line that does the conversion. It looks like a differently abled >>>> download format. >>>> >>>> One thing that might be a problem is that I believe there is a >>>> boot loader of some kind on the micas, so the download code may >>>> not actually contain a reset vector. Without a major reverse >>>> engineering effort I'm not sure how I would go about validating >>>> this assertion however. Many hex files have addresses as the >>>> first element in the line, so examining the file format might >>>> be a place to start. >>> >>> A good reference about how booting take place is the 'Boot Loader >>> Support' section from the ATmega128 datasheet (page 273): >>> http://www.atmel.com/dyn/resources/prod_documents/doc2467.pdf >>> >>> One quick thing to check is that you set the fuses in the same way as >>> TinyOS. The fuse high byte is set to 0xd9 and the fuse extended byte >>> is set to 0xff. Here is exact uisp command used for MIB510/MIB520: >>> uisp -dprog=mib510 -dserial=/dev/ttyUSB0 --wr_fuse_h=0xd9 >>> -dpart=ATmega128 --wr_fuse_e=ff --erase --upload >>> if=build/micaz/main.srec.out --verify >>> >>> All the best! >>> Razvan ME >>> >>>> farooq_s wrote: >>>>> I am trying to program the atmega128 using tinyos. I have made the >>>>> platform >>>>> similar to the micaz shemetic. However, when i run 'make micaz' to >>>>> compile >>>>> the blink application, two files main.ihex and main.srec are >>>>> generated. I >>>>> tried downloading the main.ihex file using the avrdude and avrisp mkII >>>>> programmer, the download is successfull but the blink doesnt function. >>>>> >>>>> Moreover i also want to know whats the function of main.srec file? >>>>> >>>>> Also, am i doing the correct procedure by downloading the main.ihex >>>>> file >>>>> using avrdude? >>>>> >>>>> Kindly help me in this regard. >>>>> >>>>> farooq >>>> >> _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
