This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to relocate tables from RAM to Flash memory

I am programming the STM32fM4 Discovery board with a Cortex M4F ARM CPU.
I have two large tables, which, after the initialization, are just read-only.
I would like to place them in Flash memory, to free some RAM.

I tried this :

float sintab[8192]  __attribute__((at(0x08010000)));
float costab[8192]  __attribute__((at(0x08018000)));

but the linker complains with this error message :

Error: L6985E: Unable to automatically place AT section main.o(.ARM.__AT_0x08010000) with required base address 0x08010000.
Please manually place in the scatter file using the --no_autoat option.


I am not particularly expert of this compiler/linker, so the above message is not much clear to me. Could please somebody explains how to accomplish what I want ? I don't know what a scatter file is, nor how to code one to relocate in Flash memory my two tables.

Thanks

Parents
  • I have two large tables, which, after the initialization, are just read-only.

    That's puzzling. Are you saying that you are going to initialize them at run time?
    Normally, the contents of the tables would be known at compile time. Then you would declare them as const and they would be placed in flash memory automatically.

Reply
  • I have two large tables, which, after the initialization, are just read-only.

    That's puzzling. Are you saying that you are going to initialize them at run time?
    Normally, the contents of the tables would be known at compile time. Then you would declare them as const and they would be placed in flash memory automatically.

Children