How to Build Drivers for Zephyr | Interrupt

Pulling the correct device from the .dts can be tricky. Generally you’ll get a compile error if you’re using the macros incorrectly. You’ll have to pinpoint in your code where it’s NULL where it shouldn’t be.

I’m not sure why your i2s device is inside another label though. Generally those devices are outside (no indentation). For example here’s my i2c definition for the nRF9160 Feather:

&i2c1 {
	compatible = "nordic,nrf-twim";
	status = "okay";
	sda-pin = <26>;
	scl-pin = <27>;

	pcf85063a@51 {
			compatible = "nxp,pcf85063a";
			label = "PCF85063A";
			reg = <0x51>;
	};

};

I’m actually getting the device by simply using:

device_get_binding("PCF85063A");

But I think you should be able to do something like

uart = device_get_binding(DT_LABEL(DT_NODELABEL(i2s)));

I hope that helps!