nRF54L15 Flash Issue Fix
I had a nRF54L15 sense that was refusing to flash with messages like this:
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Warn : target nrf54l.cpu examination failed
Info : starting gdb server for nrf54l.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : gdb port disabled
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* nrf54l.cpu cortex_m little nrf54l.cpu unknown
1 nrf54l.aux mem_ap little nrf54l.cpu running
Info : SWD DPIDR 0x6ba02477
Error: Failed to read memory at 0xe000ed00
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Info : [nrf54l.cpu] AP write error, reset will not halt
Info : SWD DPIDR 0x6ba02477
Error: [nrf54l.cpu] DP initialisation failed
I found that the problem can be resolved by using this command, after installing the latest PyOCD from GitHub inside a Python 3.13.7 virtual environment running under Windows 11:
python -m venv .venv
.\.venv\Scripts\activate
pip install libusb
git clone https://github.com/pyocd/pyOCD.git
cd pyOCD
python -m pyocd erase -u CD37EBB4 -t nrf54l --mass -v
In this example CD37EBB4
is the specific serial number of the nRF54L15 to erase.
You can get the device serial number with nrfutil device:
C:\> nrfutil device list
CD37EBB4
Product Seeed Studio XIAO nrf54 CMSIS-DAP
Ports COM8
Traits usb, serialPorts
Supported devices found: 1
python.exe -m pyocd erase -u CD37EBB4 -t nrf54l --mass -v
This managed to unlock it, then from the folder with a build of a working sample app:
python.exe -m pyocd load build/merged.hex -u CD37EBB4 -t nrf54l
NRF54L15 is not in a secure state [target_nRF54L]
Loading C:\peripheral_nus\build\merged.hex [load_cmd]
Erased 176128 bytes (43 sectors),
programmed 176128 bytes (43 pages),
skipped 0 bytes (0 pages) at 24.60 kBs [loader]
Special thanks to the guy on the Zephyr Discord that suggested updating to the latest PyOCD.