This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

9160 overlay for multiple spi instances

I have a couple of examples that work ok on 9160-dk and use SPI3.

However, if I try to use these on SPI1 or SPI2 I get a device not found error.

I am building with west and using this board overlay to select which SPI 

This works but not if I use spi1 or spi2

```

/*
* Copyright (c) 2019, Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

&spi3 { /* does not work on SPI1 or 2 */
mosi-pin = <31>;
compatible = "nordic,nrf-spim";
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;

/* WS2812 */
chain-length = <1>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};

/ {
aliases {
led-strip = &led_strip;
};
};

```

My prj.conf file is

```

CONFIG_SPI=y
CONFIG_LOG=y
CONFIG_LED_STRIP=y
CONFIG_LED_STRIP_LOG_LEVEL_DBG=y
CONFIG_WS2812_STRIP=y

```

I guess there is something else I need to enable other SPI devices?

I am doing this because I'm building an application that needs 3 SPIs

Any suggestions please.

Parents Reply
  • Yes.  This is what is causing the problem.

    I tried a couple of edits to that and those changes work *provided* that I don't do a pristine build.

    Is there a way to go back to the source config and make that the default for a given board so as to allow pristine builds?

    Well yes.  I edited <BOARD>_common.dts to achieve this.  The build wanted all the pins assigned there (they were aleady defined in the overlay) and I had to take out &i2c2 rather than just disable it.

    I now have 2 SPIs working and can see how to increase this to 3.

Children
No Data
Related