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

nrfjprog: --recover does not work

Hello,

I have a nrf5340 PDK .

The kit does not work right, because i got a several errors.

For example in nrf connect v.3.6.1 the PDK is shown as 000000123456 also in

C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog -i
123456

With JLink I also cannot connect to NRF5340_XXAA_NET (to NRF5340_XXAA_APP the connection is successful).

That happens, if i try to connect to NRF5340_XXAAA_NET:

SEGGER J-Link Commander V6.88a (Compiled Nov 18 2020 15:10:56)
DLL version V6.88a, compiled Nov 18 2020 15:09:23

Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-NordicSemi compiled Jan 21 2020 17:33:01
Hardware version: V1.00
S/N: 960195344
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
VTref=3.300V

Type "connect" to establish a target connection, '?' for help
J-Link>con
Please specify device / core. <Default>: NRF5340_XXAA_NET
Type '?' for selection dialog
Device>M33
Please specify target interface:
  J) JTAG (Default)
  S) SWD
  F) FINE
  I) ICSP
  C) C2
  T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000
Device "NRF5340_XXAA_NET" selected.


Connecting to target via SWD
ConfigTargetSettings() start
ConfigTargetSettings() end
InitTarget() start
CTRL-AP indicates that the device is secured.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and the network core.

Executing default behavior previously saved in the registry.
Device will be unsecured now.
InitTarget() end
ConfigTargetSettings() start
ConfigTargetSettings() end
InitTarget() start
CTRL-AP indicates that the device is secured.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and the network core.

Executing default behavior previously saved in the registry.
Device will be unsecured now.
InitTarget() end
ConfigTargetSettings() start
ConfigTargetSettings() end
InitTarget() start
CTRL-AP indicates that the device is secured.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and the network core.

Executing default behavior previously saved in the registry.
Device will be unsecured now.
InitTarget() end
ConfigTargetSettings() start
ConfigTargetSettings() end
InitTarget() start
CTRL-AP indicates that the device is secured.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and the network core.

Executing default behavior previously saved in the registry.
Device will be unsecured now.
InitTarget() end
Cannot connect to target.

I tried to recover the PDK with nrfjprog, for example:C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog --recover
ERROR: There is no debugger connected to the PC with the given serial number.

Or: C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog.exe --recover -f NRF53                                                                                                                                    C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog.exe --recover -f NRF53
Recovering device. This operation might take 30s.
ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.

Or: C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog.exe --coprocessor CP_NETWORK --recover
ERROR: There is no debugger connected to the PC with the given serial number.

Can sb. help?

Thank you!

Parents Reply
  • Hi,

    The reason for the "ERROR: There is no debugger connected to the PC with the given serial number." error is probably that nrfjprog is not able to properly read the ID of the debugger, and then Segger uses 123456 as the default ID when none is specified.

    I assume you are using the onboard debugger on the DK? Or another official Segger debugger? If so, I wonder if the firmware could be corrupted. I suggest you do the following to see if it helps:

    1. Start J-Link Configurator:

    2. Right click probe in configurator and select "Reset config", then power cycle the board.

    If the above doesn't work, you can try "Replace firmware", to reprogram the J-Link chip.

    Please let me know if this fixes the issue or not.

Children
Related