Xiao-nrf54l15 An error occurred: Memory transfer fault @ 0x00ffc31c-0x00ffc31f

I would like to ask how you link jlink and xiao_nrf54.
I tried to use Expansion Base for XIAO before, but the link was so loose that I had to press XIAO hard. But it can finally be connected.

I have three nrf54l15s, but only two connect to JLink properly. I’m carefully checking the pin and pad alignment during the process.

I am getting this:

python ..\..\scripts\xiao_nrf54l15_recover_flash.py --hex .pio\build\seeed-xiao-nrf54l15\firmware.hex --mass-erase
2025-09-11 07:55:34,725 [WARNING] STLink, CMSIS-DAPv2 and PicoProbe probes are not supported because no libusb library was found.
2025-09-11 07:55:34,925 [INFO] Auto-selected probe: 92CC15C9 (Seeed Studio CMSIS-DAP v1 Adapter)
2025-09-11 07:55:34,925 [INFO] Connecting to target...
2025-09-11 07:55:34,963 [ERROR] An error occurred: No backend available
Traceback (most recent call last):
  File "C:\GitHub\Seeed-platform-seeedboards\scripts\xiao_nrf54l15_recover_flash.py", line 234, in main
    with ConnectHelper.session_with_chosen_probe(unique_id=probe_id, **session_options) as session:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\core\helpers.py", line 265, in session_with_chosen_probe
    return Session(probe, auto_open=auto_open, options=options, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\core\session.py", line 231, in __init__
    self._board = probe.create_associated_board() or Board(self)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\probe\cmsis_dap_probe.py", line 254, in create_associated_board
    board_info = self.associated_board_info
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\probe\cmsis_dap_probe.py", line 221, in associated_board_info
    with _TemporaryOpen(self._link):
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\probe\cmsis_dap_probe.py", line 64, in __enter__
    self._device.open()
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\utility\concurrency.py", line 29, in _locking
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 750, in open
    self._interface.open()
  File "C:\Program Files\Python312\Lib\site-packages\pyocd\probe\pydapaccess\interface\hidapi_backend.py", line 96, in open
    dev = usb_find(idVendor=self.vid, idProduct=self.pid, serial_number=self.serial_number)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\libusb_package\__init__.py", line 108, in find
    return usb.core.find(*args, backend=backend, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\usb\core.py", line 1309, in find
    raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available

It seems you cannot install libusb.
Try:
pip install libusb
pip install libusb-package

This is the result of running Python in the PlatformIO directory.

PS C:\users\msfujino.platformio\python3> dir


d----- 2025/09/09 10:52 DLLs
d----- 2025/09/09 10:52 include
d----- 2025/09/09 10:52 Lib
d----- 2025/09/09 10:52 libs
d----- 2025/09/09 10:52 Tools
-a---- 2025/09/11 12:06 67435 firmware.hex
-a---- 2023/12/05 3:03 36874 LICENSE.txt
-a---- 2024/12/14 2:14 335 package.json
-a---- 2023/12/05 3:03 103192 python.exe
-a---- 2023/12/05 3:03 67352 python3.dll
-a---- 2023/12/05 3:03 5785880 python311.dll
-a---- 2023/12/05 3:03 101656 pythonw.exe
-a---- 2023/12/24 2:07 9083 README.rst
-a---- 2023/12/05 3:03 119192 vcruntime140.dll
-a---- 2023/12/05 3:03 49528 vcruntime140_1.dll
-a---- 2025/09/11 12:02 10011 xiao_nrf54l15_recover_flash.py

PS C:\users\msfujino.platformio\python3> ./python xiao_nrf54l15_recover_flash.py --hex firmware.hex --mass-erase
Installing intelhex…
C:\users\msfujino.platformio\python3\python.exe: No module named pip
Traceback (most recent call last):
File “C:\users\msfujino.platformio\python3\xiao_nrf54l15_recover_flash.py”, line 22, in
from intelhex import IntelHex
ModuleNotFoundError: No module named ‘intelhex’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\users\msfujino.platformio\python3\xiao_nrf54l15_recover_flash.py”, line 25, in
subprocess.run([sys.executable, “-m”, “pip”, “install”, “intelhex”], check=True)
File “C:\users\msfujino.platformio\python3\Lib\subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘C:\users\msfujino\.platformio\python3\python.exe’, ‘-m’, ‘pip’, ‘install’, ‘intelhex’]’ returned non-zero exit status 1.
PS C:\users\msfujino.platformio\python3>

Hi there,

SO, just a general observation. I would check what the versions of OpenOCD is installed. In all the SEEED debugger and PLio work-outs it was an issue. (PLio Version was old) I finally switched to OpenOcd for windows XPack and used the external commands. then added them to the Platform.ini file to wrap it up. :+1:

"
C:\openocd\bin>openocd -v
xPack Open On-Chip Debugger 0.12.0+dev-01850-geb6f2745b-dirty (2025-02-07-10:08)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting

C:\openocd\bin>"

and PATH , be sure the stuff you need is in the PATH or it almost never works. LOL :grin: for me.

I find this being the biggest problem on Systems with several Dev Systems and environments.

HTH
GL :slight_smile: PJ :v:

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.

1 Like

I tried it on the XIAO_nRF54L15 that I couldn’t upload to, but I get the following error.
In my environment, it seems something is still missing.

ModuleNotFoundError: No module named ‘typing_extensions’

that’s a Python Dependancy issue, make sure you’re using the python virtual environment. I only tested it with

python --version
Python 3.13.7

all of it needs to be run after activating the venv:
Create a venv in a folder named “.venv”:

c:\path\to\python313exe\python.exe -m venv .venv

Start the Venv you just created

.\.venv\Scripts\activate

You can use pip install to install dependancies and it will work:

python -m venv .venv
.\.venv\Scripts\activate
pip install libusb
git clone https://github.com/pyocd/pyOCD.git
cd pyOCD
pip install .
python -m pyocd erase -u <Your_ID> -t nrf54l --mass -v

To get the ID:

python -m pyocd list
  #   Probe/Board                                      Unique ID   Target
---------------------------------------------------------------------------
  0   Seeed Studio Seeed Studio XIAO nrf54 CMSIS-DAP   92CC15C9    n/a

Thanks for the trick but I always get a failure:

0002272 I [1]<e0040000:TPIU M33 class=9 designer=43b:Arm part=d21 devtype=11 archid=0000 devid=ca1:0:0> [rom_table]
0002278 I CPU core #0: Cortex-M33 r1p0, v8.0-M architecture [cortex_m]
0002278 I   Extensions: [DSP, FPU, FPU_V5, MPU, SEC] [cortex_m]
0002278 I   FPU present: FPv5-SP-D16-M [cortex_m]
0002280 I 4 hardware watchpoints [dwt]
0002282 I 8 hardware breakpoints, 1 literal comparators [fpb]
0002290 C Memory transfer fault (SWD/JTAG communication failure (FAULT ACK)) @ 0x00ffc31c-0x00ffc31f [__main__]

After trial and error, the script started working, but it still couldn’t recover, and it displays the same message as @lboule.

Thank you for this, that’s way better than having to switch to nrfUtil to grab the board serial.

Make sure you are NOT using the SWD pins, but are just using the usb connection provided on the xiao, or this won’t work.

So it shouldn’t be connected to the ‘Expansion Board Base for XIAO’?

For me, when doing a board recovery, I take it out of board carriers, and connect using the built in usb CDC port.

The CMSIS-DAP usb interface is actually provided by a second mcu on the same xiao, so try that way first, as the onboard debugger is virtually impossible to kill via software.

1 Like

Still the same error:
pyocd erase.zip (980 Octets)

When I run the script, I get the exact same error message.
This bricked XIAO cannot be connected to JLink via the pads on the back, so there is currently no way to recover it.

EDIT:
After repeatedly resetting it, reconnecting the USB, and running the script over and over, it suddenly managed to perform a full erase. However, when I run the script again, it sometimes throws an error, sometimes performs a full erase again—it’s extremely unstable.

1 Like