Hi,
I'm using nrf52840 in revision 3, which has protection access port enabled by default.
My application is built with SDK15.0.0 / SDS S140 6.0.0
In order to get debug session, i have added in my code the following sequence at the beginning of the main function :
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NRF_UICR->APPROTECT = UICR_APPROTECT_PALL_HwDisabled;
*(volatile uint32_t *)0x40000558 = 0x0000005A; // SwDisable registre APPROTECT.DISABLE
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
It had worked few times (i was able to do 10 debug sessions approximatively) and now i can't start debug session. Since i try to start a debug session, i have the following Jlink error :
JLink info: ------------ DLL: V8.42 , compiled Jun 11 2025 12:15:45 Firmware: J-Link V11 compiled Apr 1 2025 10:02:30 Hardware: V11.00 S/N : 51007305 Feature(s) : GDB * JLink Info: ConfigTargetSettings() start * JLink Info: ConfigTargetSettings(): Enable Monitor Mode Debugging * JLink Info: ConfigTargetSettings() end - Took 2.72ms * JLink Info: InitTarget() start * JLink Info: InitTarget() end - Took 4.74ms * JLink Info: Found SW-DP with ID 0x2BA01477 * JLink Info: Failed to power up DAP * JLink Info: ConfigTargetSettings() start * JLink Info: ConfigTargetSettings(): Enable Monitor Mode Debugging * JLink Info: ConfigTargetSettings() end - Took 3.92ms * JLink Info: InitTarget() start * JLink Info: InitTarget() end - Took 3.19ms * JLink Info: Found SW-DP with ID 0x2BA01477 * JLink Info: Failed to power up DAP Error: Flash Download failed - Target DLL has been cancelled Flash Load finished at 09:43:07
After several google researchs, i have found the IN141 v1.1, where it's advised to upgrade the MDK to the lastest version (MDK 8.40.2 or later). In my case, i'm using MDK in 8.16.0 version.
Due to this older version, It seems i have breaked my chip.
In the information notice, there are steps to recover debug port where the first step is to perform a CTRL-AP ERASEALL operation.
I have tried to do it with the nrfConnect programmer tool, however it can't to access to the chip (see log above) :
11:26:42.580 Selected device with the serial number 000051007305 11:26:42.581 Using nrfutil device to communicate with target via JLink 11:26:53.024 Reading readback protection status for Application core 11:26:53.026 Reading readback protection status for Application core 0% 11:27:03.071 Failed "reading readback protection status for application core". Error: code: 1, description: Generic, message: Batch task protection-get failed, Device error: A timeout occured while handling debug power: Timed out trying to power sys and debug region 11:27:03.079 Error: Failed with exit code 1. One or more batch tasks failed: * 51007305: Device error: A timeout occured while handling debug power: Timed out trying to power sys and debug region (Generic) Message: Batch task protection-get failed, Device error: A timeout occured while handling debug power: Timed out trying to power sys and debug region. 11:27:03.079 Error: Failed with exit code 1. One or more batch tasks failed: * 51007305: Device error: A timeout occured while handling debug power: Timed out trying to power sys and debug region (Generic) Message: Batch task protection-get failed, Device error: A timeout occured while handling debug power: Timed out trying to power sys and debug region.
Is there any way to recover the nrf chip and the debug access port?
Thanks in advance,
Antoine
