I built a custom board with the nrf5340 and a SD card connected to non-standard gpios. My SD card is connected via SPI over the P0.14, P0.15, P0.16, P0.17, respectively for CS, MISO, MOSI, CLK. Since I was not able to mount the SD card on my custom board, I moved to the evaluation kit nrf5340dk.
On the nrf5340dk I was able to succesfully exectue the example fs_sample on default pins, but when I move to P0.14, P0.15, P0.16, P0.1 there is no way I can make the fs driver to work.
Here my configuration (I tried several):
Zephyr version: 4.0.99
spi4_default: spi4_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 15)>,
<NRF_PSEL(SPIM_MOSI, 0, 16)>;
//bias-pull-up;
//nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};
spi4_sleep: spi4_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 15)>,
<NRF_PSEL(SPIM_MOSI, 0, 16)>;
low-power-enable;
};
};
then I have an overlay file for the fs_sample
&spi4 {
status = "okay";
cs-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; /* D10 */
pinctrl-0 = <&spi4_default>;
pinctrl-1 = <&spi4_sleep>;
pinctrl-names = "default", "sleep";
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
mmc {
compatible = "zephyr,sdmmc-disk";
disk-name = "SD";
status = "okay";
};
spi-max-frequency = <4000000>;
};
};
/* Enable high drive mode for the SPI3 pins to get a square signal at 8 MHz */
&spi4_default {
group1 {
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
}
I didn't find any PIN conflict between the network and app cores, and following the documentation and previous posts on the forum I don't find any other possible configuration to add.
Thanks in advance for the support.