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
Well, it's on-chip RAM. Unlike the rest or the on-chip RAM, it is not connected to the bus matrix, so it cannot be used with DMA, and code cannot be executed from it. But you don't need either of those, and it's good for data tables. Accesses should not involve any delay cycles. You use it just like you would use flash memory as described above, only writing to it is just like writing to any RAM. There must be a way to configure the linker to place the tables in the CCM. I just don't have the time to explore this. As a shortcut, the following should work (as suggested above):
float *sintab = (float *)0x10000000; float *costab = (float *)0x10008000;
As a shortcut, the following should work (as suggested above):
Thanks for the tip, I will surely explore this possibility. Seems the ideal place where to put those tables, if the dimension of this CCM will accommodate them.
TNX