avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] bootloader: replace bootloader with a new bootloader


From: E. Weddington
Subject: Re: [avr-gcc-list] bootloader: replace bootloader with a new bootloader
Date: Mon, 13 Jun 2005 05:18:05 -0600
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Joerg Wunsch wrote:

Torsten Mohr <address@hidden> wrote:
Basically, if you want to do this, you need a bootloader that is small
enough so two bootloaders will fit into the boot region.  That way, it
should be possible to reprogram the inactive half of the bootloader.
Take care to understand all the implications of programming the
No-read-while-write (NRWW) section of the flash ROM.  As soon as your
new half of the bootloader has been programmed successfully (and
verified CRC or such), flip the first page of the bootloader area to
point to the new loader.

Something similar to this, is to have your bootloader be half or less than the availble bootloader area. Then, when calling the bootloader (which resides in the lower half of the bootloader section), the first thing the bootloader does is to copy itself to the upper half of the bootloader area, then call the bootloader copy in the upper half which then does the actual bootloading. The bootloading will then write new code from the beginning of flash all the way through the first half of the bootloader section, hence replacing the bootloader. Granted, if there is a power failure then all could be lost. And, yes, this scheme actually does work.

Eric






reply via email to

[Prev in Thread] Current Thread [Next in Thread]