Annoyingly basic SWD issue? nRF52840 custom board refuses to recover

Hi everyone,

I’m trying to program/recover a custom board with an nRF52840 Fanstel module using a Nordic nRF52840 DK as the programmer. The board is powered from a 4.2 V LiPo through an LDO, and I measure a stable 3.3 V on the target VDD rail.

Because of my custom board connections, I’m using the P20 header on the DK:

  • Target 3V3/VDD → P20 SWD SEL / VTG, pin 3
  • Target SWDIO → P20 SWDIO, pin 4
  • Target SWDCLK → P20 SWDCLK, pin 5
  • Target RESET → P20 RESET
  • Target GND → DK GND on P16 nearby, since P20 does not have GND

My firmware is very simple: LED dimming and BLE transmission of 0s and 1s. There are no other sensors on the board, only basic passives.

When I try to recover the board to remove APPROTECT, both nrfutil and nrfjprog fail. For example:

nrfjprog --recover -f NRF52 --snr 1050225736 --clockspeed 100

The output includes repeated SEGGER backend errors and then:

Recovering device. This operation might take 30s.
[error] [ Client] - Encountered error -21: Command recover executed for 446 milliseconds with result -21
[error] [ Worker] - An unknown error.
ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.

I also tried lower SWD clock speeds:

nrfjprog --recover -f NRF52 --snr 1050225736 --clockspeed 100
nrfjprog --recover -f NRF52 --snr 1050225736 --clockspeed 50
nrfjprog --recover -f NRF52 --snr 1050225736 --clockspeed 10

The failures are similar.

Things I have already checked/tried:

  1. Verified target supply: 3.3 V at VDD. 
  2. Checked continuity between programmer pins and the target pads.
  3. Tried swapping SWDIO and SWDCLK in case they were reversed.
  4. Tried removing the RESET connection and recovering with only SWDIO/SWDCLK/VDD/GND.
  5. Measured the following voltages with respect to the target board GND while the target is powered and connected to the DK:
RESET: 3.33 V
Target 3V3: 3.33 V
SWDIO: 3.03 V
SWDCLK: 0.01 V
GND: 0 V

Tool versions:

nrfjprog version: 10.24.2
JLinkARM.dll version: 9.44

At this point I’m not sure whether this is a wiring issue, a power/reference voltage issue on P20, an APPROTECT recovery issue, or something specific to using the nRF52840 DK as an external programmer.

Does anyone have suggestions for what to check next?

Thanks!

Related