We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
Apparently not the first time discussed In this forum but I still could use some expertise:
I have a Cortex M0+ device and need a variable that is not cleared by a WDT reset. I have added a "noinit" section in the scatter file which now looks like this:
; *************************************************************; *** Scatter-Loading Description File generated by uVision ***; *************************************************************
LR_IROM1 0x08000000 0x00006000 { ; load region size_region ER_IROM1 0x08000000 0x00006000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM1 0x20000000 0x00000BFC { ; RW data .ANY (+RW +ZI) } RW_NOINIT 0x20000BFC UNINIT 0x00000004 { ; Uninitialized data, 4 bytes .ANY (+RW) }}
In my code a declare a variable like this:
uint32_t testVariable __attribute__((section("NOINIT"), aligned(4)));
However, after compilation, my .map file says this:
testVariable 0x2000003c Data 4 main.o(NOINIT)
I.e. it is still in the IRAM1 section and is, consequently, zeroed after WDT reset.
How do I fix this ?
Cheers
Eric
Hi Milorad,
Thank you for your swift response. Your suggestion did not help as this, according to https://developer.arm.com/documentation/ka003046/latest/, is a compiler version related issue. However, I indirectly found the fault: The path I gave to my scatter file was the same as the compiler had, i.e. my noinit section was overwritten every time I compiled. Stupid misstake !
Thanks a lot for your help !
\Eric