Re: Bootloader Placement



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
.



Relevant Pages

  • Re: Relocate from nor to ddr CE 5.0
    ... it depends on the bootloader implementation; ... programmed into flash. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How to update OS image(nk.bin) while the OS is running?
    ... flash to ram without any processing. ... For saving the image to flash, you'll need some sort of driver, yes. ... Exactly what support is needed also depends on what the bootloader ... and a new NK.bin both stored in USB disk, when the OS is running, I ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Cisco vs. Linux
    ... > (this has been Linksys router vs. Linux). ... If you think of hardware reliability, you can get PC hardware with flash ... lower-Cisco equipments are RAM and flash restricted ...
    (comp.os.linux.networking)
  • Re: Relocate from nor to ddr CE 5.0
    ... bootloader and let it think it is a flash image. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Relocate from nor to ddr CE 5.0
    ... That is the job of the bootloader; nothing special on the part of Platform ... targeted to flash, and if it is then the bootloader programs it. ... to run in RAM, ...
    (microsoft.public.windowsce.platbuilder)