With an earlier version of NCS I could set the sda and scl pins using an overlay file:
boards/nrf52840dk_nrf52840.overlay:
&i2c0 {
status = "okay";
compatible = "nordic,nrf-twim";
sda-pin = < 45 >;
scl-pin = < 47 >;
sht3xd@45 {
compatible = "sensirion,sht3xd";
reg = <0x45>;
label = "SHT3XD";
alert-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
};
};
With NCS 1.9.99 I get this error:
In file included from /home/k/ncs1999/zephyr/include/zephyr/toolchain.h:50,
from /home/k/ncs1999/zephyr/include/zephyr/init.h:10,
from /home/k/ncs1999/zephyr/include/zephyr/device.h:29,
from /home/k/ncs1999/zephyr/include/zephyr/drivers/i2c.h:23,
from /home/k/ncs1999/zephyr/drivers/i2c/i2c_nrfx_twim.c:8:
/home/k/ncs1999/zephyr/include/zephyr/toolchain/gcc.h:77:36: error: static assertion failed: "/soc/i2c@40003000 has legacy *-pin properties defined although PINCTRL is enabled"
77 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
| ^~~~~~~~~~~~~~
/home/k/ncs1999/zephyr/soc/arm/nordic_nrf/common/./soc_nrf_common.h:229:2: note: in expansion of macro 'BUILD_ASSERT'
229 | BUILD_ASSERT(!IS_ENABLED(CONFIG_PINCTRL) || \
| ^~~~~~~~~~~~
/home/k/ncs1999/zephyr/drivers/i2c/i2c_nrfx_twim.c:396:2: note: in expansion of macro 'NRF_DT_CHECK_PIN_ASSIGNMENTS'
396 | NRF_DT_CHECK_PIN_ASSIGNMENTS(I2C(idx), 1, scl_pin, sda_pin); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/k/ncs1999/zephyr/drivers/i2c/i2c_nrfx_twim.c:448:1: note: in expansion of macro 'I2C_NRFX_TWIM_DEVICE'
448 | I2C_NRFX_TWIM_DEVICE(0);
| ^~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
How do I change the sda and scl pin assignments using NCS 1.9.99?
Thanks,
Jan Erik