"NotAvailableBecauseProtection" when attempting to flash nRF54L15

Seeing the failure below and wondering a couple things:

  1. How did the device get into this state?
  2. How do I disable AP protection? The Kconfig GUI seems to indicate that it is already disabled.

Output:

Flashing build to 852003914
west flash -d application/build --dev-id 852003914
 
-- west flash: rebuilding
[0/5] Performing build step for 'application'
ninja: no work to do.
[2/5] No install step for 'application'
[3/5] Completed 'application'
[4/5] cd application/build/_sysbuild && /opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/cmake/3.21.0/bin/cmake -E true
-- west flash: using runner nrfutil
-- runners.nrfutil: reset after flashing requested
-- runners.nrfutil: Flashing file: application/build/merged.hex
Error: One or more batch tasks failed:
 - [Probe] Device is protected, code: NotAvailableBecauseProtection
 
 
The operation was unavailable for some of the devices because they had readback protection enabled. These devices might be possible to unlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
ERROR: runners.nrfutil: 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: nrfutil --json device x-execute-batch --batch-path application/build/generated_nrfutil_batch.json --serial-number 852003914
Parents Reply Children
  • This can happen automatically after certain operations, such as a reset or power cycle, if the firmware does not explicitly disable the protection on startup, or if protection settings are enabled in the build configuration. When this protection is active, attempts to flash or debug the device will fail with errors indicating that access is not available due to protection. The solution is to use the west flash --recover command (or equivalent recovery commands), which erases the device and disables the protection, restoring access for flashing and debugging. See Programming and Debugging (nrf54l15dk).

Related