I want to carve out a section of RAM with a NO_INIT qualifier.
This is my implementation. Am I on the right track?
In a c file:
#pragma DATA_SEG restart_detection_ram_data
static RestartStruct_t restart;
#pragma DATA_SEG DEFAULT
In prm file:
SEGMENTS
/* RAM 8k */
STARTUP_RAM = NO_INIT 0x001000 TO 0x00103F; // 64 bytes
RAM = READ_WRITE 0x001040 TO 0x002DFF; // 8k - 64 - 512 bytes
PLACEMENT
SSTACK, /* allocate stack first to avoid overwriting variables on overflow */
DEFAULT_RAM INTO RAM;
restart_detection_ram_data INTO STARTUP_RAM;
Hi,
Yes, your snippet of using NO_INIT section seems to be valid.
Just make sure that if there is any other variable placed to this section it is not declared as initialized.
Do you observe any particular problems with the code?
Stan
Thanks, I give it a go to figure it out.