FDS DATA Erase when NRF52840 Board OFF and ON

I used nRF52840 board with SDK 17_1_0 ,

Using FDS I am able to read and write data into flash when nRF52840 board Continuous ON,

But when i Make nRF52840 board Power OFF and ON after FDS is not able to find out existing Record

and not able to read existing write data,

so what i can do when  nRF52840 board Power OFF and ON at that time FDS data was not erase?

Parents Reply Children
  • I believe the v2.0.1 has the nRF with the old APPROTECT, and the v3.0.0 and later has the new version with the new APPROTECT (readback protection). 

    This is why I asked whether you needed to recover, either using "nrfjprog --recover", or if you were asked to do so somewhere in the process of reattaching the debugger after you power cycled it. 

    Also, the v3.0.0 and later versions of the DK has a different debugger (which you can probably see), but that shouldn't really matter.

    Perhaps you can describe to me how you are testing this. How do you monitor what's going on? Logging? UART log? RTT log? And are you ever asked if you want to recover the device?

    Best regards,

    Edvin

  • Hi,

    in debug mode I take a one default value like 0x02 ,first i read the it value if not available then i write it,

    second time i debug the program and i read value and i check variable value in WATCH and show 0x02,

    After i OFF and ON the nrf52840 Kit and I debug the program and i read value and i check variable value in WATCH and show 0,

    I also put a break point in fds_record_find but record is not found

    If readback protection then how we can read it?

    I did't used "nrfjprog --recover"

    EDIT:

    Now My problem is solve I disable the APPROTECT,

    in firmware i wrote below function

    void approtect_hw_disable(void)
    {
    if ((NRF_UICR->APPROTECT & UICR_APPROTECT_PALL_Msk)
    == (UICR_APPROTECT_PALL_Msk))
    {
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
    NRF_UICR->APPROTECT = (UICR_APPROTECT_PALL_HwDisabled << UICR_APPROTECT_PALL_Pos);
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
    NVIC_SystemReset();
    }
    }

  • Good! 

    I guess that the chip was re-programmed when you power cycled it, causing the record to disappear. After disabling APPROTECT it saw that it was already programmed with the correct application, so it didn't reprogram it again.

    Best regards,

    Edvin

Related