How to put a structure in a NO_INIT section of RAM?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to put a structure in a NO_INIT section of RAM?

910 Views
mihir_rajput
Contributor III

 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;

0 Kudos
2 Replies

895 Views
stanish
NXP Employee
NXP Employee

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

0 Kudos

820 Views
cyndymejia
Contributor I

Thanks, I give it a go to figure it out.

png to ico

0 Kudos