Bootloader from flash

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm looking for some documentation about how to write a custom bootloader that reads the new firmware from an external flash memory (for ATXmega A3).

Do you know any example on this topic? Just to avoid to start from scratch and waste a lot of time going in the wrong direction.

Thanks
Marco

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What language are you planning to do this in. If C which variant?

Just in case it's C and avr-gcc then look at:

http://www.nongnu.org/avr-libc/u...

The boot_program_page() example in that is pretty much a complete pre-written bootloader.

On the other hand you could just take any existing bootloader and recognize that each simply has a "communication channel" which often consists of some kind of uart_getchar() style function. Simply replace this with external_flash_getchar() and the rest of the code would be virtually identical.

Cliff

PS AFAIK the SPM mechanism in Xmega is very similar to that in any other Mega so don't limit your search to Xmega alone - the code for tiny/mega should be fairly adaptable for use in an Xmega.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much for your answer.
Yes I'm going to use the avr-gcc and I was afraid about the Xmega.

At the moment I'm studying the avr-libc manual (the link you provided) and the xmega datasheet.

If I will run into some difficulties I will write here again.