This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to recover nrf52832 after writing into APPROTECT register

I am using nrf52832_xxaa with SDK v11.0.I tried writing into the APPROTECT register by using the code below

sd_softdevice_disable();

NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

NRF_UICR->APPROTECT = 0xFFFFFF00;
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){}

sd_softdevice_enable(p_clock_lf_cfg, softdevice_assert_callback);

But when I tried to use the recover option I'm getting the following error

ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.

and log

--------------------------------------------------------------------------------
nrfjprog -f nrf52 --recover --log
nrfjprog verion 9.7.1
--------------------------------------------------------------------------------
FUNCTION: open_dll.
FUNCTION: open_dll.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: enum_emu_snr.
FUNCTION: connect_to_emu_with_snr.
FUNCTION: connect_to_emu_with_snr.
FUNCTION: connect_to_emu_without_snr.
FUNCTION: enum_emu_snr.
Device "NRF52832_XXAA" selected.
FUNCTION: recover.
FUNCTION: recover.
Not supported by current CPU + target interface combination.
JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -2.
JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.
FUNCTION: close_dll.
FUNCTION: close_dll.

How can I rectify this ? and recover the device?

Parents
  • Hi, could you do the following and attach both the resulting nRFJProg and Segger log files?

    1. Open J-Link Commander.
    2. Right click the small green J-Link icon in the windows task bar and press Open.
    3. Under Settings->Log File, tick the "Override" box, and specify a log file path for the Segger log.
    4. Close Control Panel, but leave J-Link Commander open.
    5. Run nrfjprog -f NRF52 --recover --log

    After you're finished, you may want to the log file setting as Segger will remember it between sessions. This can be done by removing the "Override" check mark. in the Control panel.

Reply
  • Hi, could you do the following and attach both the resulting nRFJProg and Segger log files?

    1. Open J-Link Commander.
    2. Right click the small green J-Link icon in the windows task bar and press Open.
    3. Under Settings->Log File, tick the "Override" box, and specify a log file path for the Segger log.
    4. Close Control Panel, but leave J-Link Commander open.
    5. Run nrfjprog -f NRF52 --recover --log

    After you're finished, you may want to the log file setting as Segger will remember it between sessions. This can be done by removing the "Override" check mark. in the Control panel.

Children
Related