nrfjprog --recover fails when flashing nRF52840_XXAA

Hi all,

I'm unable to flash my nRF52840_XXAA using the nRF Connect extension in VS Code. My project uses the command:

west flash -d <BUILD-DIRECTORY> --dev-id 1050304532 --recover

to mass erase the device and disable readback protection, but recovery fails. The VS Code terminal shows:

-- runners.nrfjprog: Recovering and erasing all flash memory.
Recovering device. This operation might take 30s.
[error] [ Worker] - Could not connect to CPU core. This may indicate that AP protection is enabled.
ERROR: Recover failed. Please make sure that the correct device family is given
FATAL ERROR: command exited with status 62: nrfjprog --recover -f NRF52 --snr 1050304532

The nRF Connect Desktop log reports:

INFO Recovering Application core 0%
ERROR: Batch task recover failed, [jlink] RECOVER_FAILED.

I previously powered the board mid-flash, which might have left it locked with readback protection enabled. I've also tried using J-Link Commander, but with no success.

Has anyone experienced this issue? Are there alternative recovery methods or workarounds to clear access protection?

Thanks in advance!

Related