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

'Recovery Failed. Unknown error' nRF52 DK

I have open a brand new nRF52 Development Kit. It is not recognise by the nRFgo Studio. I have tried the trick you mention on this thread:

https://devzone.nordicsemi.com/f/nordic-q-a/27216/nrf52832-can-not-be-recovered

without lack. I did flash the lastest nRF5x-OB-JLink-IF version 170724. After this trick the dev kit is updated to the latest segger firmware v22g but the recovery still gives an error. 'Recovery Failed. Unknown error'.

Any help most welcome

  • I find it very strange that you get the error "invalid argument provided --log". Could you screenshot the result of the command "nrfjprog -v" in cmd?

    Next iteration of the question requires of you coming into my office to check it. This argument does not appear on the help list neither on the infocenter http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.tools%2Fdita%2Ftools%2Fnrf5x_command_line_tools%2Fnrf5x_nrfjprogexe_reference.html

    Second test as suggested. The only difference is the compilation of the j-link firmware although the version is the same

  • That is an old version of nrfjprog. Newest version is 9.7.3. You should install a new version from here: infocenter.nordicsemi.com/index.jsp

  • Have you read the line where it says 9.7.3 form windows programs?

  • From the image, I can see that 5.2.0 is the active version. Try uninstalling, and install it again to see if it helps. nrfjprog -v must return 9.7.3 for it to be active.

  • Ok so it was a System Variable issue where both nrf51 and nrf5x were included so it was using the old version of nrfjprog

    C:\Program Files (x86)\Nordic Semiconductor\nrf51\bin\

    C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin\

    After deleting the duplicated line:

    Error. Please see log attached

    --------------------------------------------------------------------------------
    nrfjprog --recover --log
    nrfjprog version 9.7.3
    --------------------------------------------------------------------------------
    nRF_open_dll
    . nRFXX_open_dll
    . . nRFXX_dll_version
    nRF_enum_emu_snr
    . nRFXX_enum_emu_snr
    nRF_enum_emu_snr
    . nRFXX_enum_emu_snr
    nRF_connect_to_emu_with_snr
    . nRFXX_connect_to_emu_with_snr
    . . nRFXX_is_connected_to_emu
    . . nRFXX_connect_to_emu_without_snr
    . . . nRFXX_is_connected_to_emu
    . . . nRFXX_enum_emu_snr
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Updating firmware:  J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Waiting for new firmware to boot
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Waiting for new firmware to boot
    . . nRFXX_connect_to_emu_without_snr:	JLink:	New firmware booted successfully
    . . nRFXX_connect_to_emu_without_snr:	JLink:	New firmware booted successfully
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 Hardware: V1.00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 S/N: 682672018
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 TELNET listener socket opened on port 19021
    . . nRFXX_connect_to_emu_without_snr:	JLink:	WEBSRV  Starting webserver
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (5024ms, 5030ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	WEBSRV Webserver running on local port 19080
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (5290ms, 5296ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns O.K.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (5369ms, 5375ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_GetHWStatus(...)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0019ms, 5430ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("Device = NRF52832_xxAA", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	C:\Program Files (x86)\SEGGER\JLink_V622g\JLinkDevices.xml evaluated successfully.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Device "NRF52832_XXAA" selected.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Device "NRF52832_XXAA" selected.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0283ms, 5727ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("SetRestartOnClose = 0", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x01
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 5749ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("DisableFlashDL", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 5771ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x01
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 5795ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 5815ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_TIF_Select(JLINKARM_TIF_SWD)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0016ms, 5837ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_SetSpeed(2000)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0008ms, 5851ms total)  
    nRF_read_connected_emu_snr
    . nRFXX_read_connected_emu_snr
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0020ms, 5878ms total)  
    nRF_read_device_family
    . nRFXX_read_device_family
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0014ms, 5900ms total)  
    . . nRFXX_read_access_port_register
    . . . nRFXX_coresight_configure
    . . . nRFXX_coresight_configure:	JLink:	JLINK_CORESIGHT_Configure()
    . . . nRFXX_coresight_configure:	JLink:	  returns 0
    . . . nRFXX_coresight_configure:	JLink:	 (0116ms, 6023ms total)  
    . . . nRFXX_power_debug_and_system_regions
    . . . . nRFXX_write_debug_port_register
    . . . . nRFXX_write_debug_port_register:	JLink:	JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    . . . . nRFXX_write_debug_port_register:	JLink:	  returns -1
    . . . . nRFXX_write_debug_port_register:	JLink:	 (0013ms, 6043ms total)  
    . . . . nRFXX_write_debug_port_register:	JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.
    
    . . . nRFXX_power_debug_and_system_regions:	JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.
    
    nRF_close_dll
    . nRFXX_close_dll
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0012ms, 6061ms total)  
    . . nRFXX_disconnect_from_emu
    . . nRFXX_disconnect_from_emu:	JLink:	JLINK_Close()
    --------------------------------------------------------------------------------
    nrfjprog --recover --log
    nrfjprog version 9.7.3
    --------------------------------------------------------------------------------
    nRF_open_dll
    . nRFXX_open_dll
    . . nRFXX_dll_version
    nRF_enum_emu_snr
    . nRFXX_enum_emu_snr
    nRF_enum_emu_snr
    . nRFXX_enum_emu_snr
    nRF_connect_to_emu_with_snr
    . nRFXX_connect_to_emu_with_snr
    . . nRFXX_is_connected_to_emu
    . . nRFXX_connect_to_emu_without_snr
    . . . nRFXX_is_connected_to_emu
    . . . nRFXX_enum_emu_snr
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 Hardware: V1.00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 S/N: 682672018
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 TELNET listener socket opened on port 19021
    . . nRFXX_connect_to_emu_without_snr:	JLink:	WEBSRV  Starting webserver
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0054ms, 0062ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	WEBSRV Webserver running on local port 19080
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0084ms, 0092ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns O.K.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0098ms, 0106ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_GetHWStatus(...)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0013ms, 0124ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("Device = NRF52832_xxAA", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	C:\Program Files (x86)\SEGGER\JLink_V622g\JLinkDevices.xml evaluated successfully.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Device "NRF52832_XXAA" selected.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	Device "NRF52832_XXAA" selected.
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0231ms, 0367ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("SetRestartOnClose = 0", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x01
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 0386ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("DisableFlashDL", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0006ms, 0404ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x01
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0007ms, 0423ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). 
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0006ms, 0441ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_TIF_Select(JLINKARM_TIF_SWD)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	  returns 0x00
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0014ms, 0461ms total)  
    . . nRFXX_connect_to_emu_without_snr:	JLink:	JLINK_SetSpeed(2000)
    . . nRFXX_connect_to_emu_without_snr:	JLink:	 (0006ms, 0474ms total)  
    nRF_read_connected_emu_snr
    . nRFXX_read_connected_emu_snr
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0012ms, 0493ms total)  
    nRF_read_device_family
    . nRFXX_read_device_family
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0012ms, 0512ms total)  
    . . nRFXX_read_access_port_register
    . . . nRFXX_coresight_configure
    . . . nRFXX_coresight_configure:	JLink:	JLINK_CORESIGHT_Configure()
    . . . nRFXX_coresight_configure:	JLink:	  returns 0
    . . . nRFXX_coresight_configure:	JLink:	 (0120ms, 0638ms total)  
    . . . nRFXX_power_debug_and_system_regions
    . . . . nRFXX_write_debug_port_register
    . . . . nRFXX_write_debug_port_register:	JLink:	JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    . . . . nRFXX_write_debug_port_register:	JLink:	  returns -1
    . . . . nRFXX_write_debug_port_register:	JLink:	 (0013ms, 0664ms total)  
    . . . . nRFXX_write_debug_port_register:	JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.
    
    . . . nRFXX_power_debug_and_system_regions:	JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.
    
    nRF_close_dll
    . nRFXX_close_dll
    . . nRFXX_is_connected_to_emu
    . . nRFXX_is_connected_to_emu:	JLink:	JLINK_IsOpen()
    . . nRFXX_is_connected_to_emu:	JLink:	  returns 0x01
    . . nRFXX_is_connected_to_emu:	JLink:	 (0013ms, 0683ms total)  
    . . nRFXX_disconnect_from_emu
    . . nRFXX_disconnect_from_emu:	JLink:	JLINK_Close()
    

Related