Clear no init parameters after burning a new image

Hello,

I am using SoftDevice S140 SDK 7.2.0 with IAR environment.
Each time I burn a new image I need to clear all my no init parameters.
I tried to read the reset reason but I received an SW reset reason, that is the same reason when I perform SW reset from the environment.
I would be thankful if you could advise me how to know that this is the first time after downloading fw, so i could clear all my no init parametrs.

  • Hi Yair, 
    Please clarify if I'm wrong. What you want to do is to erase some initialization data you store on the flash and you want to erase it on the first run after flashing the chip ? 
    If it's the case, I don't think you would need to check for the reset reason. What you can do is to use a word in the flash, write to it a value, for example 0xCAFE. 
    When you booting up, if you read the address and find 0xCAFE, you can erase the init data and erase the address that store 0xCAFE. The address that store 0xCAFE now will store 0xFFFFFFFF. 
    On next booting if you see 0xFFFFFFFF , you know that it's not the first time after booting. 

  • "Please clarify if I'm wrong. What you want to do is to erase some initialization data you store on the flash and you want to erase it on the first run after flashing the chip ? "

    No! I want to clear the no init RAM values.

    I know that I can sign my first wake up in  the NVM, but I search for a simpler way.

  • Hi Yair, 

    Thanks for the clarification. 

    I couldn't find an easy way to detect the first run after flashing. I think signing the first run into flash is what needed. 

Related