[fpc-devel] Need an elegant way to preset a specific memory area in elf files

Michael Schnell mschnell at lumino.de
Wed Apr 23 14:19:18 CEST 2014


On 04/23/2014 10:34 AM, Michael Ring wrote:
> Thanks,
> but does not solve the problem, it's not about reading the data, it's 
> about defining the data so that it is included in the elf file in the 
> correct section so that the microcontroller is programmed with the 
> values when the elf file is uploaded to the microcontroller.
Hmm.

The said method allows for writing to such data as well. Of course only 
after some initialization is done.

If I need such stuff during the initialization, I would use ASM.

Anyway, by creating true constants (as you seem to aim for), the data 
would reside in FLASH, and never be touched by any software.

Certain processors with on-chip flash memory indeed use hardware to read 
such configuration data before the processor starts, but the only I know 
of, that might be usable with fpc (and which I in fact am eager to use 
with fpc) is PIC32 (a MIPS architecture).

-Michael



More information about the fpc-devel mailing list