"Access protection is enabled" on nrf52 DK

I have an NRF52 devkit and trying to install the "blinky" sample for the first time, using VS Code.

I can build the firmware, but when I try to flash I get these errors:



-- west flash: using runner nrfjprog
-- runners.nrfjprog: mass erase requested
-- runners.nrfjprog: Flashing file: /Users/steve/Temp/nordic/blinky_pwm/build_1/zephyr/zephyr.hex
[error] [ Client] - Encountered error -90: Command read_device_info executed for 12 milliseconds with result -90
[error] [ Client] - Encountered error -90: Command read_memory_descriptors executed for 11 milliseconds with result -90
[error] [ Worker] - Access protection is enabled, can't read device version.
[error] [ Worker] - Can't read memory descriptors, ap-protection is enabled.
[error] [ Client] - Encountered error -90: Command erase_file executed for 17 milliseconds with result -90
[error] [ nRF52] - Failed while erasing device. -90: Access protection is enabled, can't read device version.
[error] [ Worker] - Access protection is enabled, can't read device version.
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
ERROR: runners.nrfjprog: Flashing failed because the target must be recovered.
To fix, run "west flash --recover" instead.
Note: this will recover and erase all flash memory prior to reflashing.
FATAL ERROR: command exited with status 24: nrfjprog --program /Users/steve/Temp/nordic/blinky_pwm/build_1/zephyr/zephyr.hex --chiperase --verify -f NRF52 --snr 1050308588

From other posts on this board, I found suggestions to run nrfjprog -recover to remove access protection.  However that gives me a similar error:

~>nrfjprog --recover -f nrf52
Recovering device. This operation might take 30s.
[error] [ Client] - Encountered error -21: Command recover executed for 30409 milliseconds with result -21
[error] [ Worker] - Encountered error while performing post-recover cleanup. -90: Access protection is enabled, can't read device version.
ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

versions:

nrfjprog version: 10.21.0 external

JLinkARM.dll version: 7.80c

this is on macOS, but I tried it from Windows and had the same issue.

Any suggestions?

Parents Reply Children
Related