Re: Bootloader Placement
- From: Andrew M <noone@home>
- Date: Wed, 19 Apr 2006 21:27:35 +1000
On Wed, 19 Apr 2006 10:50:31 +0100, "Tom Lucas"
<news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I have written a bootloader to reside in my first sector (128Kbyte) of flash
which, firstly copies all code and data from flash to RAM and then checks
data on an MMC card to see whether an update of the flash is necessary and,
if so, copies new program data into the flash. At the moment I have two
projects - the bootloader as a stand-alone loader and the full application,
which has the bootloader code as part of it.
What I'd like to do is seperate the bootloader code from the application
code and have the boot loader pass control to the application once it has
done its checks and, if necessary, reprogramming. However, I don't think I
could have the application as stand-alone code as well because it would then
be re-initialising the hardware and memory of what was initialised
previously in the bootloader.
My thoughts were to define the first flash sector as a seperate linker
section and locate all the bootloader functions and data in there but as
part of the application software. Then, when a reprogram takes place I just
don't write to the first sector. The problem with that is that the old
bootloader then does not know where to jump to in the application and also
the copy from flash to RAM on startup won't know how much there is to copy.
I only want to write to the bootloader area when the loader itself is to be
updated because, if it fails, JTAG is the only recovery and that won't be
available in the field.
There must be a better way of doing this but I'm not sure which direction to
proceed.
IN my opinion - keep the areas completely separate and overlay them at
the latest stage possible, but if you need to reinitialise peripherals
etc, you could write a signature into RAM after the bootloader
finishes, and force a hardware reset. Once the boot code sees the
signature - and no 'boot' signal, pass control straight to the
application without initialising hardware.
-Andrew M
.
- References:
- Bootloader Placement
- From: Tom Lucas
- Bootloader Placement
- Prev by Date: Re: FM0 (bi-phase space) decoding!
- Next by Date: Re: FM0 (bi-phase space) decoding!
- Previous by thread: Re: Bootloader Placement
- Next by thread: Re: Bootloader Placement
- Index(es):
Relevant Pages
|