Hello,I'm testing the Segger linker, and I have some troubles about initializing variables.
The processor I use is an STM32H743, the linker is the Segger linker, the icf file is STM32H7xxFlash.icf provided by Segger (which defines the sections AXI_RAM1, RAM1, RAM2, etc.),
Embedded Studio Release 4.30c Build 2019120200.40763
I have an array (of structure) which I initialize with constants.
If I do not give any instruction, the table is implemented in the AXI_RAM and initialized... ok :
burst32_t burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
If I set the ram I want to use for this array, for example .RAM1 (__attribute __ ((section (". RAM1")))) the array is in the correct ram, but is NOT initialized (unless I specify ".AXI_RAM1" as the section):
burst32_t __attribute__((section(".RAM1"))) burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
If I fix its address (__attribute __ ((section (". ARM .__ at_0x30000000")))) the table is in the correct ram AND initialized.
burst32_t __attribute__((section(".ARM.__at_0x30000000"))) burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
Is this behavior normal? Is there something missing in the icf file?
Is it possible to have the variables automatically initialized in the RAM of my choice, without having to fix their address, and without having to create a specific section in the icf file (which would be a source of error in case of confusion between the section specifically initialized and the section which is not - but which should be?-)?
Best regards
Jean-Louis
The processor I use is an STM32H743, the linker is the Segger linker, the icf file is STM32H7xxFlash.icf provided by Segger (which defines the sections AXI_RAM1, RAM1, RAM2, etc.),
Embedded Studio Release 4.30c Build 2019120200.40763
I have an array (of structure) which I initialize with constants.
If I do not give any instruction, the table is implemented in the AXI_RAM and initialized... ok :
burst32_t burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
If I set the ram I want to use for this array, for example .RAM1 (__attribute __ ((section (". RAM1")))) the array is in the correct ram, but is NOT initialized (unless I specify ".AXI_RAM1" as the section):
burst32_t __attribute__((section(".RAM1"))) burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
If I fix its address (__attribute __ ((section (". ARM .__ at_0x30000000")))) the table is in the correct ram AND initialized.
burst32_t __attribute__((section(".ARM.__at_0x30000000"))) burstsDef[NBR_BURST] = {
{10-1, 0, 1, 1, 1, 1}, {10-1, 0, 2, 2, 2, 2}, {10-1, 0, 5, 5, 5, 5}, {64-1, 0, 32, 32, 32, 32},
};
Is this behavior normal? Is there something missing in the icf file?
Is it possible to have the variables automatically initialized in the RAM of my choice, without having to fix their address, and without having to create a specific section in the icf file (which would be a source of error in case of confusion between the section specifically initialized and the section which is not - but which should be?-)?
Best regards
Jean-Louis
The post was edited 1 time, last by jlvern ().