|
From: | Larry Barello |
Subject: | RE: [avr-gcc-list] AT90CAN128 bootloader |
Date: | Sat, 25 Nov 2006 12:35:50 -0800 |
I wrote a little state machine that eats the ‘0’ and ‘ ‘, printing out the ‘0’ if not followed by a space. Then it jumps to the bootloader… The bootloader also waits 3 seconds prior to running the application which is how I recover if I mess up and the escape sequence doesn’t work. Finally, you can specify an input pin to force the bootloader to take control.
Just look at the source. The linker magic is all in the makefile.
Cheers!
From: Trampas [mailto:address@hidden
Larry,
I have some stupid questions. Does the AVRDUDE and/or AVR Studio send out “0 “ to start programming? Is there some specification somewhere? What happens if user does hit “0 “ by accident?
I would very much like to do two things, one is have the automatic bootloader like you do, and the second is to integrate the bootloader into my code, thus I assume there are some special linker stuff I need to do?
Thanks again for the help.
Thanks Trampas
From: Larry Barello [mailto:address@hidden
Thanks!
IIRC you can cut out the EEPROM support and the boot loader fits into 256 words…
While paring down the size I cut out the C startup (there is no “main()”) & runtime support and moved statics/globals into automatics assuming they would go onto the stack. However that clever compiler kept everything in registers and the resulting code generation was spectacular.
One thing not mentioned in the README is if your application scans for 0x30, 0x20 (no echo) and then “jumps” to the bootloader + one instruction, you can have entry into the loader automatic. I do that with all my projects (that have user interfaces) with a tiny state machine that eats the two characters (printing them if it fails). That way I don’t have to reset or otherwise fool around: Just run AvrDude and tada! new code in 10 seconds or less. “0 “ is an unusual sequence so I never trip across it otherwise.
Cheers!
Nice work! Compiled
with avr-gcc 3.4.6 it uses just 418 instructions out of 512 and it works with
"avrdude"! -- Bruce D. Lightner Lightner Engineering La Jolla, California Voice: +1-858-551-4011 FAX: +1-858-551-0777 Email: address@hidden URL: http://www.lightner.net/lightner/bruce/ |
[Prev in Thread] | Current Thread | [Next in Thread] |