Hell @Sam_Gao
That worked great, but I don't have the correct values appearing at the ram addresses.
In model.c
/* Storage class 'OiidaData' */
__attribute__((section(".my_data"))) uint8_T AirBoxTemp_Swi_RefVal_C = 0U;
__attribute__((section(".my_data"))) uint8_T LED_Switch_C = 0U;
When reviewing my .map file:
.my_data 0x200090dc 0x2 load address
.my_data 0x200090dc 0x2 Oiida.o
0x200090dc AirBoxTemp_Swi_RefVal_C
0x200090dd LED_Switch_C
Perfect, looks good. When I look at my hex file:
0x60061a90: 01 01 ff ff 00 00 -- -- -- -- -- -- -- -- -- --
Perfect, looks good (AirBoxTemp_Swi_RefVal_C and LED_Switch_C are both unit8 "0").
But when reviewing the Ram addresses:
0x200090dc AirBoxTemp_Swi_RefVal_C: 111
0x200090dd LED_Switch_C: 88

I looked through the startup_mimxrt1062.c, and it appears to be coping flash to ram as expected:
__attribute__ ((section(".after_vectors.init_data")))
void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
unsigned int *pulDest = (unsigned int*) start;
unsigned int *pulSrc = (unsigned int*) romstart;
unsigned int loop;
for (loop = 0; loop < len; loop = loop + 4)
*pulDest++ = *pulSrc++;
}
// Copy the data sections from flash to SRAM.
while (SectionTableAddr < &__data_section_table_end) {
LoadAddr = *SectionTableAddr++;
ExeAddr = *SectionTableAddr++;
SectionLen = *SectionTableAddr++;
data_init(LoadAddr, ExeAddr, SectionLen);
}
Attached my linker script.
What am I missing?