Re: Confused about Flash



Rene Tschaggelar wrote:

yes, the hard part is to have the Code in the RAM while
doing the flash and hope the power stays on. Copy the
code from Flash to the RAM, jump to it, and when it is
done, whatever was done, do a clean reset. Since the code
copied from the flash to the RAM is on a different adress,
the code shouldn't contain any absolute jumps. Hmm, yes,
the interrupts... This procedure used be done 20 years ago.

This is easily done by adding an appropriate section in the linker
script file. You'll have to set the address to a RAM address, and the
storage to somewhere in the flash. During code init, you initialize the
RAM by copying the code, using symbolic labels that the linker
provides, or that you add to the linker script yourself. The exact
mechanism depends on the tool chain. It is very similar to the section
that hold the initialized data in RAM, so it could be just a matter of
copy/paste a few lines in the existing linker script, and make a few
modifications.

This way, you can use absolute addresses, and just call the functions
as normal code. The compiler/linker will take care of the details.

Vital interrupt handlers can be programmed in RAM, or another available
memory area in the same way. Less critical interrupts can be disabled
during flash programming/erasing.

If the CPU has cache support, you may be able to run the code from
flash, as long as you can guarantee all the code is actually in the
cache (some CPUs allow code to be locked in the cache).

.



Relevant Pages

  • Re: Performance and Flash Pipelining on TI 28F12 DSPs
    ... > of "critical code" we could move to RAM. ... > from internal flash? ... Since the external RAM is as big as the internal flash, ... the timers and all other interrupts are shut off, ...
    (comp.dsp)
  • Re: Confused about Flash
    ... doing the flash and hope the power stays on. ... code from Flash to the RAM, jump to it, and when it is ... copied from the flash to the RAM is on a different adress, ... or that you add to the linker script yourself. ...
    (sci.electronics.design)
  • Re: [ANNOUNCE] Ramback: faster than a speeding bullet
    ... The fact is, enterprise scale ramdisks are here now, while ... enterprise scale flash is not. ... does not approach the write performance of RAM, ... My goal is not to replace RAM with flash, but disk with flash. ...
    (Linux-Kernel)
  • Re: Relocate from nor to ddr CE 5.0
    ... programmed into flash. ... but the image info says it belongs to ram. ... Your bootloader needs to have code that recognizes if the image is ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • XIP vs RAM
    ... Maybe the system can even get away with the next small size RAM ... Does anyone know if/what the premimum of the "K" Strata FLASH is? ... Also what are the steps needed to transition to a XIP OS? ... >>> My bootloader create a BINFS partition and an EXTENDED partition on ...
    (microsoft.public.windowsce.platbuilder)