Can SPM instruction write from App section to Boot section?

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

Hi all,

There is fuses that control the writing (via SPM) from boot to app and boot to boot but what about app to boot?

Actually I want to download a new bootloader to the app section thru the bootloader. Then I run the "new" bootloader and send from the PC the "new new" bootloader that must overwrite the "old" bootloader.

This possible?

Thanks
Jakes

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

random AVR data sheet wrote:
24.2.1 AS - Application Section
The Application section can never store any Boot Loader code since the SPM instruction is disabled when executed from the Application section.
You have to write clever boot loader code that is capable of updating itself from the boot loader section. You will not be able to completely overwrite the entire boot loader in a single boot load operation. Typically this requires a core boot loader coexisting with but separate from the replaceable boot loader and some software mechanism to access the correct boot loader when needed. It gets messy.

Last Edited: Wed. Apr 28, 2010 - 02:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just to be a pedant but there are some AVRs in which SPM works anywhere (the mega48 springs to mind, but not the mega88/mega168). From mega48/88/168 datasheet:

Quote:
In ATmega48, there is no Read-While-Write support, and no separate Boot Loader Section. The
SPM instruction can be executed from the entire Flash.

but I suspect the OP is not using one of these "exceptional" AVRs.

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

H, thanks for your replies, I am using the ATMega1281