XIAO nRF54L15 and Wio-SX1262 doesn't work on Zephyr

Hi guys, I’m trying to use a Wio-SX1262 module with a XIAO nRF54L15 and Zephyr, but it just doesn’t work. I tested with an Arduino example, and it works (Some guy did a port to Arduino but looks like something’s doesn’t work, like the NVS storage didn’t was implemented because I can’t Join correctly, but I can see that the intent on my Gateway)

For all I say before I know is not a wiring problem, it’s something with Zephyr.

My app.overlay is this

/ {
	/*
	  * @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 = <8000000>;

		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>;
	};
};

My prj.conf is this

CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_LORA=y
CONFIG_LORA_SX126X=y
CONFIG_LORAWAN=y
CONFIG_LORAWAN_REGION_EU868=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LORAWAN_LOG_LEVEL_DBG=y
CONFIG_PRINTK=y
CONFIG_DEBUG=y
CONFIG_DEBUG_OPTIMIZATIONS=y

I always get this output:

*** Booting Zephyr OS build v4.4.0-rc1 ***
[00:13:45.893,905] <dbg> lorawan: lorawan_set_region: Selected region 5
[00:13:45.939,396] <dbg> lorawan: lorawan_start: LoRaMAC Initialized
[00:13:45.939,409] <inf> lorawan_class_a: Joining network over OTAA

And nothing more happend!

I’m using this example: zephyr/samples/subsys/lorawan/class_a at main · zephyrproject-rtos/zephyr · GitHub

Thanks for you help

Hi there,

SO I wouldn’t be so Quick with that…:grin:
Your overlay is not obviously wrong, but it is probably incomplete for the SX1262. The most likely problem is not Zephyr in general — it is that the SX1262 driver needs the board control lines defined exactly right, especially DIO1, BUSY, RESET, and often RF-switch control (tx-enable-gpios, rx-enable-gpios, or dio2-tx-enable). Zephyr supports all of those, but your current overlay only defines part of the radio interface.

Try this and the other tweaks see if you don’t get it or closer…

/ {
	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>;

		/* Use these only if the board really has separate RF switch control */
		/* tx-enable-gpios = <&xiao_d 4 GPIO_ACTIVE_HIGH>; */
		/* rx-enable-gpios = <&xiao_d 5 GPIO_ACTIVE_HIGH>; */

		/* Or, if the module uses DIO2 to control RF switching: */
		/* dio2-tx-enable; */

		status = "okay";
	};
};

I do not think You have enough evidence to say “Zephyr is broken.”

I think it is more likely one of these:

  • wrong GPIO mapping
  • missing RF switch control
  • wrong GPIO polarity
  • SPI bus/pinctrl not actually resolving how he thinks on the nRF54L15 board

That is the old story with radios:
Arduino can limp through a partial setup; Zephyr usually makes you get the hardware description right.

Try this,

  • Open build/zephyr/zephyr.dts and confirm &xiao_spi and &xiao_d resolve the way you think.
  • Lower SPI first to 1000000 or even 500000 until the radio is proven alive.
  • Confirm the exact Wio-SX1262 control lines:

:face_with_monocle:

HTH
GL :slight_smile: PJ :v: