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

J-link EDU mini can't connect to nRF52840

Hi a bit a noobie here, but I can't connect to my nRF52840 on my custom board that I made. I have tried both an ST-link V2 with openocd, flashing it into a black magic probe, and everything else I could think of. When that didn't work, I figured it would be easier wwith a J link, so I picked up a j-link edu mini from ada fruit and have been trying that. I have tried nrfjprog, J-link commander, and arduino and they all have not been able to connect to the target. I make a connection to the J link, it is only connecting to the target that fails. I tried to produce a log with nrfjprog --recover --log, but it either isn't producing a log file or I can't find it. I am using this nRF52840 module https://freqchina.en.alibaba.com/product/62501832603-810441729/bluetooth_5_0_module_mesh_module_zigbee_ANT_nRF52840_module_PTR9818.html. I have Swclk, swdio, vdd, and ground coming off the module into a 4 pin SWD connector, and connected those to my J-link via SWD.

  • VTreg is getting 3.3V when measured between that and the ground pin.

  • [2021-May-25 06:49:05] [ info] --------------------------------------------------------------------------------
    [2021-May-25 06:49:05] [ info] C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.exe --recover --log
    [2021-May-25 06:49:05] [ info] nrfjprog version 10.12.1
    [2021-May-25 06:49:05] [ info] --------------------------------------------------------------------------------
    [2021-May-25 06:49:05] [debug] [ nRF0x0] - open_dll
    [2021-May-25 06:49:05] [ info] [ nRF0x0] - Load library at C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_UNKNOWN_NRFJPROG.dll.
    [2021-May-25 06:49:05] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2021-May-25 06:49:05] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2021-May-25 06:49:05] [ info] [Backend] - Logger callback at 0xa02020 registered in Segger backend logger.
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0xa02020 registered in JLink logger.
    [2021-May-25 06:49:05] [debug] [nRFUnknown] - Just_open_dll_tagged_callback
    [2021-May-25 06:49:05] [debug] [Backend] - open_dll
    [2021-May-25 06:49:05] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2021-May-25 06:49:05] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLinkARM.dll.
    [2021-May-25 06:49:05] [ info] [Backend] - Library loaded, loading member functions.
    [2021-May-25 06:49:05] [ info] [Backend] - Member functions succesfully loaded.
    [2021-May-25 06:49:05] [debug] [Backend] - dll_version
    [2021-May-25 06:49:05] [ info] [Backend] - Segger dll version 7.20. loaded.
    [2021-May-25 06:49:05] [debug] [Backend] - set_core_data
    [2021-May-25 06:49:05] [debug] [ nRF0x0] - enum_emu_snr
    [2021-May-25 06:49:05] [debug] [nRFUnknown] - Just_enum_emu_snr
    [2021-May-25 06:49:05] [debug] [Backend] - enum_emu_snr
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_enum_emu_snr
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_get_num_emus
    [2021-May-25 06:49:05] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2021-May-25 06:49:05] [debug] [nRFUnknown] - Just_connect_to_emu_with_snr
    [2021-May-25 06:49:05] [debug] [Backend] - connect_to_emu_with_snr
    [2021-May-25 06:49:05] [debug] [Backend] - is_connected_to_emu
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_enum_emu_snr
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_get_num_emus
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2021-May-25 06:49:05] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2021-May-25 06:49:05] [ info] [Backend] - Segger logging enabled.
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Decompressing FW timestamp took 122 us
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Hardware: V1.00
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] S/N: 801032241
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Feature(s): FlashBP, GDB
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Looking for J-Link GUI Server exe at: C:\Program Files (x86)\SEGGER\JLink\JLinkGUIServer.exe
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] Forking J-Link GUI Server: C:\Program Files (x86)\SEGGER\JLink\JLinkGUIServer.exe
    [2021-May-25 06:49:05] [ info] [ JLink] - [Info ] [JLink ] J-Link GUI Server info: "J-Link GUI server V7.20 "
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 2258.729ms returns "O.K."
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(...)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.160ms returns 0
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.012ms returns 0x01
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("DisableFlashDL", ...).
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.006ms returns 0x00
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.005ms returns 0x00
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(...)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.027ms returns 0
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.408ms returns 0x00
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.066ms
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.011ms returns 801032241
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_load_core_data
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("device = Cortex-M4", ...).
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] Device "CORTEX-M4" selected.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] Device "CORTEX-M4" selected.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 45.747ms returns 0x00
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [ nRF0x0] - read_connected_emu_snr
    [2021-May-25 06:49:07] [debug] [nRFUnknown] - Just_read_connected_emu_snr
    [2021-May-25 06:49:07] [debug] [Backend] - read_connected_emu_snr
    [2021-May-25 06:49:07] [debug] [Backend] - is_connected_to_emu
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.068ms returns 0x01
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [ nRF0x0] - read_device_family
    [2021-May-25 06:49:07] [debug] [nRFUnknown] - Just_read_device_family
    [2021-May-25 06:49:07] [debug] [Backend] - is_connected_to_emu
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.012ms returns 0x01
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
    [2021-May-25 06:49:07] [debug] [Backend] - read_debug_port_idr
    [2021-May-25 06:49:07] [debug] [Backend] - read_debug_port_register
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_read_debug_port_register
    [2021-May-25 06:49:07] [debug] [Backend] - coresight_configure
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_Configure()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 99.902ms returns 0
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_select_debug_port_register
    [2021-May-25 06:49:07] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.528ms returns -1
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_abort_debug_action
    [2021-May-25 06:49:07] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.501ms returns -1
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.038ms
    [2021-May-25 06:49:07] [debug] [ nRF0x0] - close_dll
    [2021-May-25 06:49:07] [debug] [nRFUnknown] - Just_close_dll
    [2021-May-25 06:49:07] [debug] [Backend] - close
    [2021-May-25 06:49:07] [debug] [Backend] - disconnect_from_emu
    [2021-May-25 06:49:07] [debug] [Backend] - is_connected_to_emu
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.014ms returns 0x01
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_disconnect_from_emu
    [2021-May-25 06:49:07] [debug] [Backend] - is_connected_to_device
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsConnected()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.013ms returns FALSE
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_read_debug_port_register
    [2021-May-25 06:49:07] [debug] [Backend] - is_connected_to_emu
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.013ms returns 0x01
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_select_debug_port_register
    [2021-May-25 06:49:07] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.484ms returns -1
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-25 06:49:07] [debug] [Backend] - ---just_abort_debug_action
    [2021-May-25 06:49:07] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.517ms returns -1
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-25 06:49:07] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] - 0.039ms
    [2021-May-25 06:49:07] [ info] [ JLink] - [Info ] [JLink ] JLINK_Close()
    [2021-May-25 06:49:07] [debug] [Backend] - Segger Backend closed.

  • Hi,

    I don't have any experience with this module, nor can I prove that it's actually a real one. We have seen that people have bought non-legit from sites such as Alibaba and Ebay and then have connection issues.

    Nevertheless,

    Assuming that it's actually a real nRF inside:

    For SWD to work you need to route out the:

    • VCC
    • SWDIO
    • SWDCLK
    • RESET(optional)

    You also need to make sure that the nRF is supplied when you try to debug. It seems that you are supplying the nRF 3V3 via the debug interface, but I can't see where the supply is connected to the debugger?

    regards

    Jared 

  • Hi,

    I don't have any experience with this module, nor can I prove that it's actually a real one. We have seen that people have bought non-legit from sites such as Alibaba and Ebay and then have connection issues.

    Nevertheless,

    Assuming that it's actually a real nRF inside:

    For SWD to work you need to route out the:

    • VCC
    • SWDIO
    • SWDCLK
    • RESET(optional)

    You also need to make sure that the nRF is supplied when you try to debug. It seems that you are supplying the nRF 3V3 via the debug interface, but I can't see where the supply is connected to the debugger?

    regards

    Jared 

    Hi I have the 3V3, SWDIO, SWCLK, and ground coming off the board with a 4 pin header. I connected 3V3 -> Vref, SWDIO -> SWIO, SWCLK ->CLK, and GND -> GNDP

  • Kageni said:
    Hi I have the 3V3, SWDIO, SWCLK, and ground coming off the board with a 4 pin header. I connected 3V3 -> Vref, SWDIO -> SWIO, SWCLK ->CLK, and GND -> GNDP

     Ok perfect, in addition to this you need to make sure the board is supplied externally while trying to connect to it. 

Related