Hello,
I am currently developing a program that uses two SPI interfaces with the nRF5340DK. I want to use SPI3 and SPI4 for two different modules. SPI4 works fine and I can not make SPI3 to compile correctly. I get an error:
/home/rui/ncs/v2.6.99-cs2/zephyr/include/zephyr/drivers/pinctrl.h:91:17: error: 'PINCTRL_STATE_DT_N_S_soc_S_peripheral_50000000_S_spi_c000_PINCTRL_IDX_0_UPPER_TOKEN' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_a000_PINCTRL_IDX_0_UPPER_TOKEN'?
My device tree overlay looks like this:&spi3 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi3_default>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
chain-length = <8>; /* arbitrary; change at will */
color-mapping = <1 2 3>;
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
&pinctrl {
spi4_default: spi4_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>;
};
};
uart2_default: uart2_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 1)>,
<NRF_PSEL(UART_RTS, 0, 11)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 1, 0)>,
<NRF_PSEL(UART_CTS, 0, 10)>;
bias-pull-up;
};
};
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 6)>,
<NRF_PSEL(SPIM_MOSI, 1, 7)>,
<NRF_PSEL(SPIM_MISO, 1, 5)>;
};
};
};
According to the datasheet, SPIM3 is available and can be used. Is there any errors on my overlay?
Best Regards,
Rui