Prevent zero-initialized arrays in CCMRAM from being stored in FLASH.
I am using the CCMRAM to store some large array which should be zero-initialized.
My definition for the arrays is similar to:
__attribute__ ((section (".ccmram")))
uint32_t large_array[4096];Obviously, there is no constructor for these and there should not be a need to store the initial value of this array in flash. However, that is what the linker is doing.
The relevant portion of my linker script is as follows:
CCMRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
...
/* uninitialized data in CCMRAM */
.ccmram :
{
. = ALIGN(4);
_sccmram = .; /* create a global symbol at ccmram start */
*(.ccmram)
*(.ccmram*)
. = ALIGN(4);
_eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT >FLASHHow do I get the linker to not store these in flash?
I tried removing the ">FLASH" from the previous line, however the binary file produced grew fro ~200kB to 200MB, which is not desired.
If I move these arrays to RAM and remove the __attribute__ line, it works as desired.
I'm using GNU for ARM compiler/linker targeting an STM32F429ZI.
