AnsweredAssumed Answered

Why does noinit section get initialized after a reset of LPC54S018M?

Question asked by Rex Lam on May 31, 2019
Latest reply on Jun 10, 2019 by Rex Lam

I have an LPCXpresso54S018M (LPC54S018M-EVK) board. I am trying to set up a noinit section in SRAM0:


    /* This must be the first section in SRAM_0_1_2_3 */
    .noinit (NOLOAD): ALIGN(4)
        _noinit = .;
         . = ALIGN(4) ;
        _end_noinit = .;
    } > SRAM_0_1_2_3


In my code in both images, I allocated the following variable in the noinit section:

__NOINIT_DEF MyFlags my_flags;


Every time the MCU resets (without losing power), the value 0xBF30B671 is written to every word in SRAM_0_1_2_3. This defeats the purpose of the noinit section. I have tried with images from both MCUXpresso and Keil, and both produce the same result. It seems to be a property of the MCU, and not the compiler.


Could someone tell me how to successfully add a noinit section to SRAM0 on the LPC54S018M please?