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:[EMAIL PROTECTED] 
Sent: Saturday, November 25, 2006 10:11 AM
To: 'Larry Barello'; 'Bruce D. Lightner'
Cc: 'AVR GCC List'
Subject: RE: [avr-gcc-list] AT90CAN128 bootloader

 

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:[EMAIL PROTECTED] 
Sent: Saturday, November 25, 2006 12:59 PM
To: 'Bruce D. Lightner'
Cc: 'Trampas'; 'AVR GCC List'
Subject: RE: [avr-gcc-list] AT90CAN128 bootloader

 

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"!

Yahoo groups is a bit of a "pain" that others may not have the patience for!
(Why do they need to know my sex, birthday and my mother's maiden name?).
I've posted a ZIP file here too...

  http://www.lightner.net/avr/bootstap/ARCbootloader.zip

Best regards,

Bruce

-- 
 Bruce D. Lightner
 Lightner Engineering
 La Jolla, California
 Voice: +1-858-551-4011
 FAX: +1-858-551-0777
 Email: [EMAIL PROTECTED]
 URL: http://www.lightner.net/lightner/bruce/
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to