I'm trying to use the nRF Desktop project as a base for our project, prototyping on the nrf54l15dk_nrf54l15_cpuapp board target. I have an overlay file defined like this:
&i2c21 {
status = "okay";
compatible = "nordic,nrf-twim", "i2c-device";
pinctrl-0 = <&i2c21_default>;
pinctrl-1 = <&i2c21_sleep>;
pinctrl-names = "default", "sleep";
clock-frequency = <I2C_BITRATE_FAST>;
bmi270: bmi270@69 {
compatible = "bosch,bmi270";
reg = <0x69>;
irq-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
};
};
&pinctrl {
i2c21_default: i2c21_default {
group1 {
psels = <NRF_PSEL(TWIM_SCL, 1, 11)>, <NRF_PSEL(TWIM_SDA, 1, 12)>;
};
};
i2c21_sleep: i2c21_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 11)>, <NRF_PSEL(TWIM_SCL, 1, 12)>;
low-power-enable;
};
};
};
&nfct {
status = "disabled";
};
Which yields the following build failure:
from /.../sdk-nrf/v3.1.1/zephyr/drivers/i2c/i2c_nrfx_twim.c:7:
/.../sdk-nrf/v3.1.1/zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "/soc/peripheral@50000000/i2c@c7000 defined without sleep state"
87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
| ^~~~~~~~~~~~~~
/.../sdk-nrf/v3.1.1/zephyr/soc/nordic/common/./soc_nrf_common.h:235:9: note: in expansion of macro 'BUILD_ASSERT'
235 | BUILD_ASSERT(!IS_ENABLED(CONFIG_PM_DEVICE) || \
| ^~~~~~~~~~~~
/.../sdk-nrf/v3.1.1/zephyr/drivers/i2c/i2c_nrfx_twim.c:255:9: note: in expansion of macro 'NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP'
255 | NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.../sdk-nrf/v3.1.1/zephyr/drivers/i2c/i2c_nrfx_twim.c:326:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
326 | I2C_NRFX_TWIM_DEVICE(21);
| ^~~~~~~~~~~~~~~~~~~~
[295/422] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
ninja: build stopped: subcommand failed.
I can see the build system is picking up this overlay, and I can also see it in device tree VSCode GUI. The GUI can modify the file fine and there are no parse errors. The configurations I have set are:
CONFIG_ASSERT=y CONFIG_ASSERT_LEVEL=2 ... #I2C and sensors configuration CONFIG_I2C=y CONFIG_PINCTRL=y CONFIG_I2C_NRFX=y CONFIG_SENSOR=y CONFIG_BMI270=y CONFIG_I2C_DW_EXTENDED_SUPPORT=y
I'm at a loss trying to debug this any further. As far as I can tell, I have everything set up correctly. Please let me know if I'm missing something.