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!

  • Hi ileneken3,

    nRFGo Studio is deprecated for the nRF52 Series. You should use either nrfjprog from nRF5 Command Line Tools  or the nRF Programmer app in nRF Connect for Desktop

    How are you connecting the nRF52 module to the nRF52 DK?

    Could you try to run the following command

    nrfjprog -f nrf52 --recover --log

    Bjørn 

  • I hooked it up according to this:

    https://devzone.nordicsemi.com/f/nordic-q-a/20536/programming-external-custom-nrf52832-board-using-nrf52-dk

    2019-Jan-09 02:32:07 --------------------------------------------------------------------------------
    2019-Jan-09 02:32:07 C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\nrfjprog.exe -f nrf52 --recover --log
    2019-Jan-09 02:32:07 nrfjprog version 9.8.1
    2019-Jan-09 02:32:07 --------------------------------------------------------------------------------
    2019-Jan-09 02:32:07 nRF_open_dll
    2019-Jan-09 02:32:07 . nRF52_open_dll
    2019-Jan-09 02:32:07 . . nRF52_dll_version
    2019-Jan-09 02:32:07 nRF_enum_emu_snr
    2019-Jan-09 02:32:07 . nRF52_enum_emu_snr
    2019-Jan-09 02:32:07 . . nRF52_enum_emu_snr
    2019-Jan-09 02:32:07 nRF_enum_emu_snr
    2019-Jan-09 02:32:07 . nRF52_enum_emu_snr
    2019-Jan-09 02:32:07 . . nRF52_enum_emu_snr
    2019-Jan-09 02:32:07 nRF_connect_to_emu_with_snr
    2019-Jan-09 02:32:07 . nRF52_connect_to_emu_with_snr
    2019-Jan-09 02:32:07 . . nRF52_is_connected_to_emu
    2019-Jan-09 02:32:07 . . nRF52_enum_emu_snr
    2019-Jan-09 02:32:07 . . nRF52_connect_to_emu_with_snr
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 12 2018 11:44:41
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: Hardware: V1.00
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: S/N: 682351449
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: TELNET listener socket opened on port 19021
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Starting webserver
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: (0021ms, 0029ms total)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Webserver running on local port 19080
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: (0023ms, 0031ms total)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: returns O.K.
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: (0025ms, 0033ms total)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_GetHWStatus(...)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: (0005ms, 0039ms total)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: There is no generic nRF52 device in J-Link, so we select NRF52832_xxAA.

    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("Device = NRF52832_xxAA", ...).
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: XML file found at: C:\Program Files (x86)\SEGGER\JLink_V640\JLinkDevices.xml
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: (0002ms, 0045ms total)
    2019-Jan-09 02:32:07 . . . nRF52_connect_to_emu_without_snr: JLink: C:\Program Files (x86)\SEGGER\JLink_V640\JLinkDevices.xml evaluated successfully.
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected.
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0110ms, 0153ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetRestartOnClose = 0", ...).
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0156ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("DisableFlashDL", ...).
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0158ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...).
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0161ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0002ms, 0164ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_TIF_Select(JLINKARM_TIF_SWD)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0003ms, 0167ms total)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_SetSpeed(2000)
    2019-Jan-09 02:32:08 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0169ms total)
    2019-Jan-09 02:32:08 nRF_recover
    2019-Jan-09 02:32:08 . nRF52_recover
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: returns 0x01
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: (0002ms, 0172ms total)
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_device
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_device: JLink: returns FALSE
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_device: JLink: (0001ms, 0174ms total)
    2019-Jan-09 02:32:08 . . nRF52_readback_status
    2019-Jan-09 02:32:08 . . . nRF52_is_ctrl_ap_available

    2019-Jan-09 02:32:08 . . . . nRF52_read_access_port_register
    2019-Jan-09 02:32:08 . . . . . nRF52_coresight_configure
    2019-Jan-09 02:32:08 . . . . . nRF52_coresight_configure: JLink: JLINK_CORESIGHT_Configure()
    2019-Jan-09 02:32:08 . . . . . nRF52_coresight_configure: JLink: returns 0
    2019-Jan-09 02:32:08 . . . . . nRF52_coresight_configure: JLink: (0105ms, 0280ms total)
    2019-Jan-09 02:32:08 . . . . . nRF52_power_debug_and_system_regions
    2019-Jan-09 02:32:08 . . . . . . nRF52_write_debug_port_register
    2019-Jan-09 02:32:08 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    2019-Jan-09 02:32:08 . . . . . . nRF52_write_debug_port_register: JLink: returns -1
    2019-Jan-09 02:32:08 . . . . . . nRF52_write_debug_port_register: JLink: (0005ms, 0286ms total)
    2019-Jan-09 02:32:08 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

    2019-Jan-09 02:32:08 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

    2019-Jan-09 02:32:08 nRF_close_dll
    2019-Jan-09 02:32:08 . nRF52_close_dll
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen()
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: returns 0x01
    2019-Jan-09 02:32:08 . . nRF52_is_connected_to_emu: JLink: (0004ms, 0291ms total)
    2019-Jan-09 02:32:08 . . nRF52_disconnect_from_emu
    2019-Jan-09 02:32:08 . . . nRF52_is_connected_to_device
    2019-Jan-09 02:32:08 . . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected()
    2019-Jan-09 02:32:08 . . . nRF52_is_connected_to_device: JLink: returns FALSE
    2019-Jan-09 02:32:08 . . . nRF52_is_connected_to_device: JLink: (0003ms, 0295ms total)
    2019-Jan-09 02:32:08 . . . nRF52_unpower_debug_and_system_regions
    2019-Jan-09 02:32:08 . . nRF52_disconnect_from_emu: JLink: JLINK_Close()

    Thank you

  • Ok and you have verified that you have connected to the correct pins(SWDCLK and SWDIO) on the module as well as if its powered with the appropriate VDD? 

    A picture of the setup would be useful.

  • I verified the connections, and measured the 3.3V coming out of the serial adapter. All the 3.3V is in the orange mini breadboard. All the ground is in the white one.

Related