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

Can't unlock and program an external NRF52832 chip using NRF -DK.

I am trying to program an EBYTE 2G4M04S1B module. After connecting to the NRF-DK, in nRFgo Studio, I get the "No device detected, or readback protection may be set GUI", but when I hit the "Recover" button, it just says: "Recover failed: Unknown error".


If I try from the command line using nrfjprog.exe, the following is logged:

2018-Dec-27 22:32:24 --------------------------------------------------------------------------------
2018-Dec-27 22:32:24 nrfjprog.exe -r -f NRF52 --log
2018-Dec-27 22:32:24 nrfjprog version 9.8.1
2018-Dec-27 22:32:24 --------------------------------------------------------------------------------
2018-Dec-27 22:32:24 nRF_open_dll
2018-Dec-27 22:32:24 . nRF52_open_dll
2018-Dec-27 22:32:24 . . nRF52_dll_version
2018-Dec-27 22:32:24 nRF_enum_emu_snr
2018-Dec-27 22:32:24 . nRF52_enum_emu_snr
2018-Dec-27 22:32:24 . . nRF52_enum_emu_snr
2018-Dec-27 22:32:24 nRF_enum_emu_snr
2018-Dec-27 22:32:24 . nRF52_enum_emu_snr
2018-Dec-27 22:32:24 . . nRF52_enum_emu_snr
2018-Dec-27 22:32:24 nRF_connect_to_emu_with_snr
2018-Dec-27 22:32:24 . nRF52_connect_to_emu_with_snr
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu
2018-Dec-27 22:32:24 . . nRF52_enum_emu_snr
2018-Dec-27 22:32:24 . . nRF52_connect_to_emu_with_snr
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 12 2018 11:44:41
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: Hardware: V1.00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: S/N: 682351449
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: TELNET listener socket opened on port 19021
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Starting webserver
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0023ms, 0032ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Webserver running on local port 19080
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0025ms, 0034ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns O.K.
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0027ms, 0036ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_GetHWStatus(...)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0005ms, 0045ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: There is no generic nRF52 device in J-Link, so we select NRF52832_xxAA.

2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("Device = NRF52832_xxAA", ...).
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: XML file found at: C:\Program Files (x86)\SEGGER\JLink_V640\JLinkDevices.xml
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0004ms, 0052ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: C:\Program Files (x86)\SEGGER\JLink_V640\JLinkDevices.xml evaluated successfully.
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0112ms, 0160ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetRestartOnClose = 0", ...).
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0161ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("DisableFlashDL", ...).
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0164ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...).
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0166ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0169ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_TIF_Select(JLINKARM_TIF_SWD)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0003ms, 0173ms total)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_SetSpeed(2000)
2018-Dec-27 22:32:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0175ms total)
2018-Dec-27 22:32:24 nRF_read_device_version
2018-Dec-27 22:32:24 . nRF52_read_device_version
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: returns 0x01
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: (0002ms, 0178ms total)
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_device
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_device: JLink: returns FALSE
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_device: JLink: (0002ms, 0180ms total)
2018-Dec-27 22:32:24 . . nRF52_readback_status
2018-Dec-27 22:32:24 . . . nRF52_is_ctrl_ap_available
2018-Dec-27 22:32:24 . . . . nRF52_read_access_port_register
2018-Dec-27 22:32:24 . . . . . nRF52_coresight_configure
2018-Dec-27 22:32:24 . . . . . nRF52_coresight_configure: JLink: JLINK_CORESIGHT_Configure()
2018-Dec-27 22:32:24 . . . . . nRF52_coresight_configure: JLink: returns 0
2018-Dec-27 22:32:24 . . . . . nRF52_coresight_configure: JLink: (0104ms, 0284ms total)
2018-Dec-27 22:32:24 . . . . . nRF52_power_debug_and_system_regions
2018-Dec-27 22:32:24 . . . . . . nRF52_write_debug_port_register
2018-Dec-27 22:32:24 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
2018-Dec-27 22:32:24 . . . . . . nRF52_write_debug_port_register: JLink: returns -1
2018-Dec-27 22:32:24 . . . . . . nRF52_write_debug_port_register: JLink: (0004ms, 0290ms total)
2018-Dec-27 22:32:24 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

2018-Dec-27 22:32:24 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

2018-Dec-27 22:32:24 nRF_close_dll
2018-Dec-27 22:32:24 . nRF52_close_dll
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: returns 0x01
2018-Dec-27 22:32:24 . . nRF52_is_connected_to_emu: JLink: (0003ms, 0295ms total)
2018-Dec-27 22:32:24 . . nRF52_disconnect_from_emu
2018-Dec-27 22:32:24 . . . nRF52_is_connected_to_device
2018-Dec-27 22:32:24 . . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()
2018-Dec-27 22:32:24 . . . nRF52_is_connected_to_device: JLink: returns FALSE
2018-Dec-27 22:32:24 . . . nRF52_is_connected_to_device: JLink: (0003ms, 0300ms total)
2018-Dec-27 22:32:24 . . . nRF52_unpower_debug_and_system_regions
2018-Dec-27 22:32:24 . . nRF52_disconnect_from_emu: JLink: JLINK_Close()

Thanks ahead of time!

  • Ok, so the serial adapter is providing 3.3V and ground to the to the custom module?

    Could you try to provide VDD and GND from the nRF52 DK? 

    Make the following connections from the P20 Header to the module:

    P20 VDD - 3.3v on  EBYTE 2G4M04S1B module

    P20 SWDIO  -> SWDIO on EBYTE 2G4M04S1B module

    P20 SWDCLK -> SWDCLK onEBYTE 2G4M04S1B module

    In addition connect VDD from the P1 header to VTG on the P20 header, this will ensure that the external nRF52 target is programmed and not the one on the DK. Also connect GND from P1 to GND on the EBYTE 2G4M04S1B module

    Best regards
    Bjørn

  • I re-did the wiring as you described, and it was the same result. BUT - after resoldering the board to the custom breakout board, it worked!

    Thanks for the help. I hope others can learn from this - it's always good to check continuity with a multimeter - especially if your eyes aren't what they used to be.

  • No problem, we're happy to help! Glad to hear that you're now able to program the custom board. 

1 2