How do I place an INITIALIZED struct on a specific location in RAM?
I'm working with the STM32F7 microcontroller and I compile using STM32CubeIDE. I want to place myStruct on a specific location in RAM and I want it be initialized automatically:
MEMORY {
...
MY_STRUCT_MEMORY(rwx): ORIGIN = 0x20007BA0 LENGTH = 8
...
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2097152
}
SECTIONS {
...
.myStructSection :
{
. = ALIGN(4);
KEEP(*(.myStructSection))
*(.myStructSection .myStructSection.*)
. = ALIGN(4);
} >MY_STRUCT_MEMORY
...
}
typedef struct { int myInt1; int myInt2; } MyStruct_s;
__attribute__ ((section(".myStructSection"),used)) MyStruct_s myStruct = {12345, 67890};Does anybody know what I'm missing?
