This might be a simple one to answer but I'm struggling to find documentation on what to do here since we're still using an ancient SDK on 9160.
I have a working board file with SPI2 in use:
&spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <0>;
mosi-pin = <28>;
miso-pin = <27>;
};
I have a problem that appears after my first spi_write / spi_read call where MOSI is held high between transactions. The best way around this seems to be to use pinctrl to configure a sleep state for these pins so I can use pm_device_state_set. I believe I have a well formed devicetree now:
&pinctrl {
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
<NRF_PSEL(SPIM_MOSI, 0, 28)>,
<NRF_PSEL(SPIM_MISO, 0, 27)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
<NRF_PSEL(SPIM_MOSI, 0, 28)>,
<NRF_PSEL(SPIM_MISO, 0, 27)>;
low-power-enable;
};
};
}; and #include "exampleboard-pinctrl.dtsi"
&spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
};
However, I am getting uninformative syntax errors when opening the project. Looking into the nordic,nrf-spim yaml file in Zephyr, I see it has no knowledge of pinctrl and needs pins to be defined directly. It really seems like SDK 1.8.0 just doesn't support pinctrl, is this correct? There is mention of it back in the old documentation but it wasn't clear.
If this SDK doesn't support pinctrl, what alternative approach can I use to keep my SPI pins held low (or released as inputs) between transactions? I should mention that I've tried configuring the pin as GPIO and overriding it, among other things, and it seems impossible to take control of the pin back after the first SPI transaction.
Many thanks.