heres my var declared as noint
Code: Select all
static int32_t var __attribute__ ((section (".noinit")));
Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess
Code: Select all
static int32_t var __attribute__ ((section (".noinit")));
Code: Select all
.ram7_init : ALIGN(4)
{
. = ALIGN(4);
__ram7_init_text__ = LOADADDR(.ram7_init);
__ram7_init__ = .;
KEEP(*(.ram7_init))
KEEP(*(.ram7_init.*))
. = ALIGN(4);
} > ram7 AT > RAM_INIT_FLASH_LMA
.ram7 (NOLOAD) : ALIGN(4)
{
. = ALIGN(4);
__ram7_clear__ = .;
*(.ram7_clear)
*(.ram7_clear.*)
. = ALIGN(4);
__ram7_noinit__ = .;
*(.ram7)
*(.ram7.*)
. = ALIGN(4);
__ram7_free__ = .;
} > ram7
Giovanni wrote:There are 3 kinds:
.ramX_init is initialized with data or code.
.ramX_clear is zeroed.
-ramX is not initialized.
Symbols are exported for the base of the various sub-areas:Code: Select all
.ram7_init : ALIGN(4)
{
. = ALIGN(4);
__ram7_init_text__ = LOADADDR(.ram7_init);
__ram7_init__ = .;
KEEP(*(.ram7_init))
KEEP(*(.ram7_init.*))
. = ALIGN(4);
} > ram7 AT > RAM_INIT_FLASH_LMA
.ram7 (NOLOAD) : ALIGN(4)
{
. = ALIGN(4);
__ram7_clear__ = .;
*(.ram7_clear)
*(.ram7_clear.*)
. = ALIGN(4);
__ram7_noinit__ = .;
*(.ram7)
*(.ram7.*)
. = ALIGN(4);
__ram7_free__ = .;
} > ram7
Giovanni
alex31 wrote:many thanks for the question, and his answer !
I had struggle with non initialization of static variable in ram section for some months, because i used the ramX which is not init.
I will be able to remove the memset that i had to to to manually initialize variable or arrays.
Now that the api is written and lot code use it, it must be kept as it is, but, for conformance with standard variable declaration where
init is done, i had choosen
.ramX_noinit is not initialized.
.ramX_clear is zeroed.
-ramX is initialized with data or code.
Anyway, thanks for information
Alexandre
Users browsing this forum: No registered users and 44 guests