Anders Johansson

How to create/link a program that runs ONLY in flash memory

Discussion created by Anders Johansson on Jun 20, 2006
Latest reply on Jun 22, 2006 by CompilerGuru
I would like to upload one or more applications to flash memory,
and then on reset/boot have a small handler runing in block 0
jump to one of the applications.
 
The application can then upload an upgrade of itself and put it
in a free block of flash memory, generate a reset, and have the
block 0 handler jumpstart to the new application.
 
This is basically a live firmware upload with only a second of downtime
for restart of the new uploaded version. I believe this is a safe "bootload"
approach since the uploaded program can be checksummed before
it starts. Also the upload is allowed to crash without bringing the
application down for good, as might happen in a conventional RAM-based
bootloader.
 
Now to my question:
Is it possible to locate a program entirely in flash memory,
so it will not need anything stored in for instance 0xC000
or any other area under 0xFFFF?
 
I realize the vector table is an issue here, but I think I can
handle that via a secondary vector table to jmp into the
correct table, hopefully also stored in flash.
 
Thanks for any pointers in the right direction,
Anders J
 

Outcomes