Unable to recover a nrf5340 MCU after first flash on a custom board using nrf5340 DK

Dear,

I was trying to flash a custom board using a nrf5340 module (Raytac MDBT53-1M) threw P20 connection of a nrf5340-DK like described in https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5340_dk%2FUG%2Fdk%2Fext_programming_support_P20.html.

I am able to read its memory before flashing anything using nrf Programmer. To reduce the possible power issue investigation, I shorted my DK SB47 and use P20 power for the custom board.

I flashed our firmware initially designed using the DK on that custom board, but when done, it is not possible to communicate with it anymore, and by the way not possible to recover it or erase its flash.

I attached the log of the command:
nrfjprog --recover --family nRF53 --log

[2024-Feb-07 11:05:26] [debug] --------------------------------------------------------------------------------
[2024-Feb-07 11:05:26] [debug] nrfjprog --recover --family nRF53 --log 
[2024-Feb-07 11:05:26] [debug] nrfjprog version 10.23.0 external
[2024-Feb-07 11:05:26] [debug] --------------------------------------------------------------------------------
[2024-Feb-07 11:05:26] [ info] Load library at /opt/nrf-command-line-tools/lib/libnrfjprogdll.so.
[2024-Feb-07 11:05:26] [ info] Library loaded, loading member functions.
[2024-Feb-07 11:05:26] [ info] Member functions succesfully loaded.
[2024-Feb-07 11:05:26] [debug] [ Client] - open
[2024-Feb-07 11:05:26] [debug] [ Client] - start
[2024-Feb-07 11:05:26] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence a19ba77f-de80-4d65-936c-07d744b730a8.
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
[2024-Feb-07 11:05:26] [debug] [  JLink] - Logger sink registered in JLink logger
[2024-Feb-07 11:05:26] [debug] [  nRF53] - open
[2024-Feb-07 11:05:26] [debug] [  nRF53] - just_check_family
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - open_dll
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
[2024-Feb-07 11:05:26] [ info] [SeggerBackend] - Load library at /opt/SEGGER/JLink/libjlinkarm.so.7.88.10.
[2024-Feb-07 11:05:26] [trace] [ Client] - Command open executed for 5 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [ Client] - config
[2024-Feb-07 11:05:26] [trace] [ Client] - Command config executed for 4 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [ Client] - enum_emu_snr
[2024-Feb-07 11:05:26] [ info] [SeggerBackend] - Library loaded, loading member functions.
[2024-Feb-07 11:05:26] [ info] [SeggerBackend] - Member functions succesfully loaded.
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Set batch mode
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - dll_version
[2024-Feb-07 11:05:26] [ info] [SeggerBackend] - Segger dll version 7.88.j loaded.
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command open executed for 4 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [  nRF53] - config
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - enum_emu_snr
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command config executed for 4 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [  nRF53] - enum_emu_con_info
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - enum_emu_con_info
[2024-Feb-07 11:05:26] [trace] [ Client] - Command enum_emu_con_info executed for 108 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [ Client] - connect_to_emu_with_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command enum_emu_con_info executed for 108 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [  nRF53] - connect_to_emu_with_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - connect_to_emu_with_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_enum_emu_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_get_num_emus
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_connect_to_emu_with_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_connect_to_emu_without_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Segger logging enabled.
[2024-Feb-07 11:05:26] [trace] [  JLink] - Firmware: J-Link OB-nRF5340-NordicSemi compiled Oct 30 2023 12:13:06
[2024-Feb-07 11:05:26] [trace] [  JLink] - Firmware: J-Link OB-nRF5340-NordicSemi compiled Oct 30 2023 12:13:06
[2024-Feb-07 11:05:26] [trace] [  JLink] - Hardware: V1.00
[2024-Feb-07 11:05:26] [trace] [  JLink] - S/N: 1050097424
[2024-Feb-07 11:05:26] [trace] [  JLink] - OEM: SEGGER
[2024-Feb-07 11:05:26] [trace] [  JLink] - Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
[2024-Feb-07 11:05:26] [trace] [  JLink] - Bootloader: 2021 May 18
[2024-Feb-07 11:05:26] [trace] [  JLink] - USB speed mode: Full speed (12 MBit/s)
[2024-Feb-07 11:05:26] [trace] [  JLink] - TELNET listener socket opened on port 19021
[2024-Feb-07 11:05:26] [trace] [  JLink] - WEBSRV WEBSRV_Init(): Starting webserver thread(s)
[2024-Feb-07 11:05:26] [trace] [  JLink] - WEBSRV Webserver running on local port 19080
[2024-Feb-07 11:05:26] [trace] [  JLink] - Looking for J-Link GUI Server exe at: /opt/SEGGER/JLink/JLinkGUIServerExe 
[2024-Feb-07 11:05:26] [trace] [  JLink] - Forking J-Link GUI Server: /opt/SEGGER/JLink/JLinkGUIServerExe 
[2024-Feb-07 11:05:26] [trace] [ Client] - Command connect_to_emu_with_snr executed for 341 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [ Client] - read_connected_emu_snr
[2024-Feb-07 11:05:26] [trace] [ Client] - Command read_connected_emu_snr executed for 0 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [ Client] - recover
[2024-Feb-07 11:05:26] [trace] [  JLink] - J-Link GUI Server info: "J-Link GUI server V7.88j " 
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 35.924ms returns "O.K."  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_Lock()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_ExecCommand("SetRestartOnClose = 0", ...).   
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.003ms returns 0x01  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_ExecCommand("DisableFlashDL", ...).   
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.002ms returns 0x00  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).   
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.002ms returns 0x00  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_SetHookUnsecureDialog  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_SetHookUnsecureDialog(...)
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.005ms returns 0  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_TIF_Select(JLINKARM_TIF_SWD)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.406ms returns 0x00  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_GetSpeedInfo()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - 128000000 Hz / n, n >= 64
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.008ms  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Connected emulator supports SWD speeds up to 2000kHz
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_SetSpeed(2000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.063ms  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_GetSpeed()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.002ms returns 2000  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - SWD clock set to 2000kHz
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_GetSN()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.002ms returns 1050097424  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.004ms  
[2024-Feb-07 11:05:26] [debug] [  nRF53] - read_device_family
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command connect_to_emu_with_snr executed for 341 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [  nRF53] - read_connected_emu_snr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_IsOpen()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.003ms returns 0x01  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_Lock()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - read_connected_emu_snr
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.002ms  
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command read_connected_emu_snr executed for 0 milliseconds with result 0
[2024-Feb-07 11:05:26] [debug] [  nRF53] - recover
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_IsOpen()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.003ms returns 0x01  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_Lock()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [debug] [  nRF53] - just_recover
[2024-Feb-07 11:05:26] [debug] [  nRF53] - Just_is_eraseprotect_enabled
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - read_access_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_read_access_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - coresight_configure
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_GetHWStatus(...)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.097ms returns 0  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_Configure()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 101.610ms returns 0  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - read_debug_port_idr
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - read_debug_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_read_debug_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_select_debug_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Select AP 255, DP Bank 0, AP Bank 255
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.662ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.636ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.606ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.655ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.644ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.597ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.520ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.534ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.543ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.483ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.442ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.445ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.456ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.446ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.437ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.439ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.447ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.478ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.454ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.503ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.456ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.484ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.437ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.524ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.457ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.498ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.433ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.432ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.439ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [error] [ Client] - Encountered error -21: Command recover executed for 123 milliseconds with result -21
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.438ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.437ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.426ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.470ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.469ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.450ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.443ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.443ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.452ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.448ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.452ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.448ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.429ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.120ms  
[2024-Feb-07 11:05:26] [error] [ Worker] - An unknown error.
[2024-Feb-07 11:05:26] [trace] [ Worker] - Command recover executed for 123 milliseconds with result -21
[2024-Feb-07 11:05:26] [debug] [  nRF53] - close
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_IsOpen()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.010ms returns 0x01  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_Lock()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - close
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - disconnect_from_emu
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_disconnect_from_emu
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - is_connected_to_device
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_IsConnected()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.006ms returns FALSE  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_is_debug_region_powered
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_read_debug_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_select_debug_port_register
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Select AP 255, DP Bank 0, AP Bank 255
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.438ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.459ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.430ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.519ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.449ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.499ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.428ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.520ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.470ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.491ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.429ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.526ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.431ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.528ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.451ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.504ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.431ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.430ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.456ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.452ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.500ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.428ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.436ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.432ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.430ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.449ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.424ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.431ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.423ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.428ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.448ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.469ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.454ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.487ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.428ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.443ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - ---just_abort_debug_action
[2024-Feb-07 11:05:26] [debug] [SeggerBackend] - Attempting to clear any configuration errors in debug port before closing connection. 
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.438ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.432ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.420ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.431ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)  
[2024-Feb-07 11:05:26] [trace] [  JLink] - - 0.424ms returns -1  
[2024-Feb-07 11:05:26] [trace] [  JLink] - JLINK_HasError()  

I also tried on another computer (and OS), but got exactly the same. Also tried another board, and got exactly same result: first capable to read flash, after programming => blocked.

Is there a way to force a factory reset of the nrf5340 when it is not communicating anymore? What could be the root of that issue?

Thanks a lot for your expertise!

Kind regards,

Michael

Related