đŸ’„ The Xiao gets a Debugger... Seeedineers make MAGIC!

thank you I believe I bricked the bootloader on my nrf54l15 and wanted to find a good solderless solution as I am very green in embedded stuff

Hi there,

No worries, You’re in the right place, Seems the nRF54L15 is more susceptible to
soft-bricking. A couple threads exists. Also the Xiao Dev Expansion board has the pogos and pin connections also to support the Jtag or DAP devices.

HTH
GL :slight_smile: PJ :v:

Several methods are available to get you back on track
 Search those threads you will find scripts, jtags, CMIS-DAP and more :grin: :+1:
You may be able now to post a new topic for your Situation. :v:

1 Like

Hi PJ

Wow, this looks amazing. If I understood correctly, this works even with the Grove Vision AI Module V2?

Best regards.

Hi, I’m stuck trying to debug, I’m using the xiao nRF54L15 and always I get this error

Error: Failed to read memory at 0x1000005c
Error: Couldn't read CONFIGID register
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected

Hi there,

Looks like you might need an Update, What version are you using the L15 is new so be sure you have all the updates. Now the 20M is hitting the streets.
You can lower the speed too, sometimes that helps slow things down.

HTH
GL :slight_smile: PJ :v:

I’m using this (no sense version): Seeed Studio XIAO nRF54L15(Sense) | Seeed Studio Wiki

Lower the speed didn’t work.

It fails when I try using west debug and when I use openocd mannually.

Hi there,

Can you post the GDB setup and command line you are using? When you build with the GDB, besure the ELF file is present.
and which version of OCD ?
Are you using the latest .CFG file, (it’s complaining about the configuration) Need more info on your setup.
did you attach in WSL ?
Yea need to know more, Please.

HTH
GL :slight_smile: PJ :v:

I use this command to open a openocd serve: openocd -f interface/cmsis-dap.cfg -f /home/xyz15/Donwloads/openocd.cfg

where the openocd.cfg file is this file platform-seeedboards/zephyr/boards/arm/xiao_nrf54l15/support/openocd.cfg at main · Seeed-Studio/platform-seeedboards · GitHub

when I try to connect using gdb with this command: target remote localhost:3333

I get the error before mentioned.

I normally use Clion with zephyr environment (west debug), it fails there too.

I use Linux.

Openocd version: Open On-Chip Debugger 0.12.0

Hi there,

Ah’ Linux. :grin: OK..well that just means you need to do it a little different than what the Wiki has listed.
Stop launching raw OpenOCD by hand first.
For the XIAO nRF54L15 on Linux, the safest path is to let Zephyr/NCS west drive the toolchain so it picks the board runner, scripts, and build artifacts together. Zephyr’s own docs define west build, west flash, west debug, west debugserver, and west attach as the standard flow, and Nordic’s NCS docs mirror that. :backhand_index_pointing_left: I use Nrf_SDK and Jlink from the DK .
I have a demo on here using GDB and openOCD outside of the version for PlatformIO. Give it a look may find something in there useful.

Meanwhile

That specific Error .. usually means OpenOCD and the target description are not lining up cleanly at connect time, Either SPeed to High or GDB is attaching in a way the OpenOCD target script does not like. OpenOCD’s own docs mention gdb_memory_map disable and set remote interrupt-on-connect off as fixes for cases where flash probing or attach handling is the problem. Try those for a Hip shot.

or

Open a shell where the Nordic nRF Connect SDK environment is already set. In practice that means using the NCS toolchain environment or sourcing the SDK environment before running west. On this Seeed forum, people specifically called out that running from the proper nRF terminal/environment matters for XIAO nRF54L15 workflows.
Make sure the board files exist where Zephyr can see them, A Seeed forum notes that newer preview releases already included the files, while older setups required copying the XIAO board directory in manually. Quick Check to be Imprint Certain :smile:

west boards | grep xiao_nrf54l15

If nothing shows up, Zephyr still does not know about the board.

So I know you said that " west flash succeeds " but I do it without opening OCD manually.. Try this open the sample or just try the order of it.
1.

west build -p always -b xiao_nrf54l15/nrf54l15/cpuapp zephyr/samples/hello_world

or , This way providing the Board Root explicitly. (I do it this way, preffered)

west build -p always \
  -b xiao_nrf54l15/nrf54l15/cpuapp \
  zephyr/samples/hello_world \
  -- -DBOARD_ROOT=/path/to/platform-seeedboards/zephyr

I like it this way
 FLASH

west flash -d build

From in the Build DIR too. Works every time
Your succeeds, which is a strong sign the basic board support is there.
Then use the debug from the same build Dir no guessing

west debug -d build

This matters because west debug uses the runner configuration generated during the build, instead of a guess which OpenOCD interface file and target file to combine by hand. Zephyr and Nordic both document this as the intended debug flow.:crossed_fingers:

If You want to see all of it setup a split terminal flow, use west debugserver + GDB like this:

Terminal 1

west debugserver -d build

Terminal 2

arm-zephyr-eabi-gdb build/zephyr/zephyr.elf

Then inside GDB:

set remote interrupt-on-connect off
target remote :3333
monitor reset halt
load
break main
continue

OpenOCD’s docs explicitly call out set remote interrupt-on-connect off, and also note that disabling gdb_memory_map can help when flash probing during attach is what breaks the session 99% of the time

HTH
GL :slight_smile: PJ :v:

If raw GDB attach still fails, I was told to try these OpenOCD/GDB workarounds
but it worked when I Opened the Terminal and tried it the first time. YMMV :crossed_fingers:

Inside GDB, before target remote:

set remote interrupt-on-connect off
set mem inaccessible-by-default off

And if you insist on :grin: using an OpenOCD config manually, Try and add:

gdb_memory_map disable

If OpenOCD won’t cooperate, switch to pyOCD :+1:

pip install -U pyocd
pyocd list
pyocd load -t nrf54l build/zephyr/zephyr.hex

If pyocd list sees the board as nrf54l, that is a very good sign the probe and target are healthy.

The only way to do it working to me was using: pyocd gdbserver --target=nrf54l --persist

and then connect via gdb

Hey maybe you know how to use nrf54l15 with a wio sx1262 using zephyr ?

I was using this overlay:

/ {
	/*
	  * @brief Device Tree Overlay for XIAO nRF54L15
	  *
	  * This file customizes the base board device tree to configure
	  * peripherals for a specific application, including:
	  * - SX1262 via SPI
	  */

	//Aliases for easy access to devices in application code
	aliases {
		lora0 = &lora0;
		spi0 = &xiao_spi;
	};
};

// SPI peripheral
&xiao_spi {
	compatible = "nordic,nrf-spim";
	status = "okay";
	// D0 pin for Chip Select
	cs-gpios = <&xiao_d 0 GPIO_ACTIVE_LOW>;

	//Lora module
	lora0: sx1262@0 {
		compatible = "semtech,sx1262";
		reg = <0>;
		label = "SX1262";

		spi-max-frequency = <1000000>;

		reset-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>;
		//antenna-enable-gpios = <&xiao_d 4 GPIO_ACTIVE_LOW>;
		busy-gpios = <&xiao_d 3 GPIO_ACTIVE_HIGH>;
		dio1-gpios = <&xiao_d 1 GPIO_ACTIVE_HIGH>;
		rx-enable-gpios = <&xiao_d 4 GPIO_ACTIVE_HIGH>;
	};

	aliases {
		lora0 = &lora0;
	};
};

But looks like it doesn’t work and I don’t find any example about it.

Hi there,
I also was able to " ATTACH the USB port in WSL " first , WSL USB manager
it has to be persistent to be available across terminals, FYI
(it’s in the video or demo)

HTH
GL :slight_smile: PJ :v:

Hi there,

So , Yes, it should be possible, but I don’t think your overlay is proven correct yet.
The SX1262 binding in Zephyr supports exactly this kind of setup over SPI, but the risky part is the board pin mapping, not the concept. Your overlay likely needs cleanup, and I would not assume D0..D4 are correct until they are matched to the actual Wio-SX1262 wiring on the XIAO nRF54L15. Also, aliases should only be under the root node, not inside the SPI node.:v:

Here is a Cleaner version to try;

/ {
	aliases {
		lora0 = &lora0;
	};
};

&xiao_spi {
	status = "okay";
	cs-gpios = <&xiao_d 0 GPIO_ACTIVE_LOW>;

	lora0: sx1262@0 {
		compatible = "semtech,sx1262";
		reg = <0>;
		spi-max-frequency = <1000000>;

		reset-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>;
		busy-gpios  = <&xiao_d 3 GPIO_ACTIVE_HIGH>;
		dio1-gpios  = <&xiao_d 1 GPIO_ACTIVE_HIGH>;

		/* Only if the module really uses separate RF switch control */
		rx-enable-gpios = <&xiao_d 4 GPIO_ACTIVE_HIGH>;

		status = "okay";
	};
};

Before changing anything else, build once and inspect build/zephyr/zephyr.dts and confirm:

  • &xiao_spi resolves to the SPI controller you think it does
  • &xiao_d exists on that board
  • the chosen D pins really correspond to NSS, DIO1, RESET, BUSY, and RF switch
  • no other peripheral already owns those pins

there’s a good chance the overlay is naming the right signals on the wrong GPIOs.

HTH
GL :slight_smile: PJ :v:

Start a new thread please
 Maybe " Wio-SX1262 wiring to the XIAO nRF54L15 "
you are over the debug with this one..:grin: