My application uses a SPI LED driver, which I routed on a PCB to the most convenient pins for routing.
I have already tested my firmware on a nRF52833 DK with an Arduino shield. This uses the spi3 pin assignment on the default DTS.
arduino_spi: &spi3 {
status = "okay";
sck-pin = <23>;
miso-pin = <22>;
mosi-pin = <21>;
cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
};
Now i want to remap this spi3 to the pins I used for routing. To do so I have included the following line on my CMakeLists.txt:
set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833dk_nrf52833.overlay")
And my overlay file looks like this:
&spi3 {
status = "okay";
sck-pin = <26>; //P0.26
miso-pin = <40>; //P1.08
mosi-pin = <5>; //P0.05
cs-gpios = <31>; //P0.31
};
I tested this modification running some dupont cables to the appropiate pins, still with the nRF52833. What does work is changing the pin assignment on the code, for example using a custom structure like:
const struct spi_cs_control ctrl =
{
.gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
.delay = 0,
.gpio_pin = 31,
.gpio_dt_flags = (GPIO_ACTIVE_LOW)
};
Which is the best way to get this to work?
It doesn't look like the overlay file is doing anything, as my code doesn't work.