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

How to use SPI on nRF9160DK

Hi!

I am trying to get this example to work on my nRF9160 board:  https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/spi/

It compiles and flashes just fine, and it seems to boot and run correctly:

***** Booting Zephyr OS v1.14.99-ncs1 *****
SPIM Example
TX sent: 0
RX recv: 0
TX sent: 1
RX recv: 0
TX sent: 2
RX recv: 0

However, the SPI pins (P0.10, P0.11, P0.12, p0.13) don't show any activity, they seem to be floating. The secure bootloader says that SPI3 is non-secure (​"12 NRF_SPIM3 Non-Secure OK").

I haven't changed the example code at all. I am using the v0.4.0 release tag, and building for the nrf9160_pca10090ns board using west.

Is there any more configuration that I must do?

Regards,

Linus

Parents Reply
  • I have the same tags in my repos. I have tried to rebuild everything, but the problem remained.

    I tried to debug it using 'west debug', but for some reason the code refuses to run in the debugger.

    However, using printk() I found out that the SPI pins were not changed, even though the .overlay file in the SPI example was correct. Then I noticed that the symlink 'nrf9160_pca10090_ns.overlay' doesn't match the board name. I renamed it to 'nrf9160_pca10090ns.overlay' and voila! Now it works!

    The question now is why it worked for you. Don't you have the same overlays?

    Regards,

    Linus

Children
Related