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

Unable to connect through J-Link. Getting "ERROR: Could not find core in Coresight setup"

Hi,

I'm having issue connecting to the nRF52840_DK through J-Link and nrfjprog. I was able to connect to it the first time and upload simple BLE sample, but afterwards I have had no luck connecting to the device again.

We have tested this on both MacOS and Windows, failing on both. With another board, we are able to connect both places.

When trying to connect directly from J-Link, I get the following error:

LOG: J-Link RTT Viewer V6.52b: Logging started.
LOG: Terminal 0 added.
LOG: Connecting to J-Link via USB...
LOG: Device "NRF52840_XXAA" selected.
LOG: InitTarget() start
LOG: InitTarget() end
LOG: Found SW-DP with ID 0x2BA01477
LOG: Could not power-up debug power domain.
LOG: Scanning AP map to find all available APs
LOG: AP[0]: Stopped AP scan as end of AP map has been reached
LOG: Iterating through AP map to find AHB-AP to use
LOG: InitTarget() start
LOG: InitTarget() end
LOG: Found SW-DP with ID 0x2BA01477
LOG: Could not power-up debug power domain.
LOG: Scanning AP map to find all available APs
LOG: AP[0]: Stopped AP scan as end of AP map has been reached
LOG: Iterating through AP map to find AHB-AP to use
ERROR: Could not find core in Coresight setup
ERROR: Could not connect to target device.

This is the log from running "nrfjprog --family NRF52 --eraseall --log`.

2020-Jul-02 11:03:04  --------------------------------------------------------------------------------
2020-Jul-02 11:03:04  nrfjprog --family NRF52 --eraseall --log 
2020-Jul-02 11:03:04  nrfjprog version 10.9.0 
2020-Jul-02 11:03:04  --------------------------------------------------------------------------------
2020-Jul-02 11:03:04  nRF_logger_open
2020-Jul-02 11:03:04  nRF_logger_open:	nRFJProg logger opened to callback at address 0X10B1ACC80
2020-Jul-02 11:03:04  nRF_open_dll
2020-Jul-02 11:03:04  nRF_open_dll:	Load library at "/Applications/Nordic Semiconductor/nrfjprog/libjlinkarm_nrf52_nrfjprogdll.dylib".

2020-Jul-02 11:03:04  . nRF52_logger_open
2020-Jul-02 11:03:04  . nRF52_logger_open:	nRFJProg logger opened to callback at address 0X10B22C310
2020-Jul-02 11:03:04  . nRF52_open
2020-Jul-02 11:03:04  . . Segger_logger_open
2020-Jul-02 11:03:04  . . Segger_logger_open:	nRFJProg logger opened to callback at address 0X10B2539B0
2020-Jul-02 11:03:04  . . Segger_open_dll
2020-Jul-02 11:03:04  . . Segger_open_dll:	No J-Link DLL path was provided. Attempting to auto detect.

2020-Jul-02 11:03:04  . . Segger_open_dll:	Load library at "/Applications/SEGGER/JLink/libjlinkarm.6.52.2.dylib".

2020-Jul-02 11:03:04  . . . Segger_dll_version
2020-Jul-02 11:03:04  nRF_enum_emu_snr
2020-Jul-02 11:03:04  . nRF52_enum_emu_snr
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu
2020-Jul-02 11:03:04  . . Segger_enum_emu_snr
2020-Jul-02 11:03:04  . . . Segger_enum_emu_snr
2020-Jul-02 11:03:04  . . . . Segger_get_num_emus
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu
2020-Jul-02 11:03:04  nRF_connect_to_emu_with_snr
2020-Jul-02 11:03:04  . nRF52_connect_to_emu_with_snr
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu
2020-Jul-02 11:03:04  . . Segger_connect_to_emu_with_snr
2020-Jul-02 11:03:04  . . . Segger_is_connected_to_emu
2020-Jul-02 11:03:04  . . . Segger_enum_emu_snr
2020-Jul-02 11:03:04  . . . . Segger_get_num_emus
2020-Jul-02 11:03:04  . . . Segger_connect_to_emu_with_snr
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	Segger logging enabled with callback at 0x4482112016.

2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 Firmware: J-Link V10 compiled Jan  7 2020 16:51:47
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 Hardware: V10.10
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 S/N: 50122404
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 Feature(s): GDB
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 TELNET listener socket opened on port 19021
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	WEBSRV  Starting webserver
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0013ms, 0018ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	WEBSRV Webserver running on local port 19081
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0013ms, 0018ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns O.K.
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0013ms, 0018ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_Lock()
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0000ms, 0018ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_GetHWStatus(...)
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0002ms, 0002ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_ExecCommand("SetRestartOnClose = 0", ...). 
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0x01
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0000ms, 0002ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_ExecCommand("DisableFlashDL", ...). 
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0000ms, 0002ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). 
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0000ms, 0002ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_SetHookUnsecureDialog(...)
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0001ms, 0003ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_TIF_Select(JLINKARM_TIF_SWD)
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0001ms, 0004ms total)  
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	JLINK_SetSpeed(2000)
2020-Jul-02 11:03:04  . . . . Segger_connect_to_emu_without_snr:	JLink INFO	 (0000ms, 0004ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...). 
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	 (0000ms, 0004ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	JLINK_ExecCommand("device = nRF52", ...). 
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	XML file found at: /Applications/SEGGER/JLink_V652b/JLinkDevices.xml
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	 (0001ms, 0005ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	/Applications/SEGGER/JLink_V652b/JLinkDevices.xml evaluated successfully.
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	 (0002ms, 0006ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	Device "NRF52" selected.
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	  returns 0x00
2020-Jul-02 11:03:04  . . . . . Segger_load_core_data:	JLink INFO	 (0036ms, 0040ms total)  
2020-Jul-02 11:03:04  . . Segger_read_debug_port_idr
2020-Jul-02 11:03:04  . . . Segger_read_debug_port_register
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register
2020-Jul-02 11:03:04  . . . . . Segger_coresight_configure
2020-Jul-02 11:03:04  . . . . . Segger_coresight_configure:	JLink INFO	JLINK_CORESIGHT_Configure()
2020-Jul-02 11:03:04  . . . . . Segger_coresight_configure:	JLink INFO	  returns 0
2020-Jul-02 11:03:04  . . . . . Segger_coresight_configure:	JLink INFO	 (0102ms, 0142ms total)  
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register:	JLink INFO	JLINK_CORESIGHT_ReadAPDPReg(DP reg 0x00)
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register:	JLink INFO	 -- failed
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register:	JLink INFO	  returns -1
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register:	JLink INFO	 (0002ms, 0144ms total)  
2020-Jul-02 11:03:04  . . . . Segger_read_debug_port_register:	JLinkARM.dll reported "-1", an unknown error.

2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action
2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action:	Attempting to clear any configuration errors in debug port before closing connection. 

2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action:	JLink INFO	JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action:	JLink INFO	  returns -1
2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action:	JLink INFO	 (0001ms, 0145ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_abort_debug_action:	JLinkARM.dll reported "-1", an unknown error.

2020-Jul-02 11:03:04  . . :	JLink INFO	JLINK_Unlock()
2020-Jul-02 11:03:04  . . :	JLink INFO	 (0147ms, 0165ms total)  
2020-Jul-02 11:03:04  nRF_close_dll
2020-Jul-02 11:03:04  . nRF52_close
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu:	JLink INFO	JLINK_IsOpen()
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu:	JLink INFO	  returns 0x01
2020-Jul-02 11:03:04  . . Segger_is_connected_to_emu:	JLink INFO	 (0000ms, 0165ms total)  
2020-Jul-02 11:03:04  . . :	JLink INFO	JLINK_Lock()
2020-Jul-02 11:03:04  . . :	JLink INFO	 (0000ms, 0165ms total)  
2020-Jul-02 11:03:04  . . Segger_close
2020-Jul-02 11:03:04  . . . Segger_disconnect_from_emu
2020-Jul-02 11:03:04  . . . . Segger_disconnect_from_emu
2020-Jul-02 11:03:04  . . . . . Segger_is_connected_to_device
2020-Jul-02 11:03:04  . . . . . Segger_is_connected_to_device:	JLink INFO	JLINK_IsConnected()
2020-Jul-02 11:03:04  . . . . . Segger_is_connected_to_device:	JLink INFO	  returns FALSE
2020-Jul-02 11:03:04  . . . . . Segger_is_connected_to_device:	JLink INFO	 (0000ms, 0000ms total)  
2020-Jul-02 11:03:04  . . . . . Segger_is_debug_region_powered
2020-Jul-02 11:03:04  . . . . . . Segger_read_debug_port_register
2020-Jul-02 11:03:04  . . . . . . . Segger_write_debug_port_register
2020-Jul-02 11:03:04  . . . . . . . Segger_write_debug_port_register:	JLink INFO	JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
2020-Jul-02 11:03:04  . . . . . . . Segger_write_debug_port_register:	JLink INFO	  returns -1
2020-Jul-02 11:03:04  . . . . . . . Segger_write_debug_port_register:	JLink INFO	 (0000ms, 0000ms total)  
2020-Jul-02 11:03:04  . . . . . . . Segger_write_debug_port_register:	JLinkARM.dll reported "-1", an unknown error.

2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action
2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action:	Attempting to clear any configuration errors in debug port before closing connection. 

2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action:	JLink INFO	JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action:	JLink INFO	  returns -1
2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action:	JLink INFO	 (0000ms, 0000ms total)  
2020-Jul-02 11:03:04  . . . . . . . . Segger_abort_debug_action:	JLinkARM.dll reported "-1", an unknown error.

2020-Jul-02 11:03:04  . . . . Segger_disconnect_from_emu:	JLink INFO	JLINK_Unlock()
2020-Jul-02 11:03:04  . . . . Segger_disconnect_from_emu:	JLink INFO	 (0004ms, 0169ms total)  
2020-Jul-02 11:03:04  . . . . Segger_disconnect_from_emu:	JLink INFO	JLINK_Close()
2020-Jul-02 11:03:04  . . Segger_close:	Freeing Library.

2020-Jul-02 11:03:04  nRF_close_dll:	Freeing Library.

The output of this command is:

ERROR: Low voltage detected at the target. Please make sure the device is
ERROR: properly supplied.

So it all looks like an power issue, but we have tried with a fully charged battery.

Any suggestions?

Related