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

SPI configuration on nRF52832

Hi, Dear Nordic experts:

I encountered with a couple of *** issue while configuring SPI port on nRF52832 with PCA10040 demo board. Here I wrap up as below:

  1. First, I tried to enable both TWI0 (master) and SPI0 based on the example project "spi_pca1004" contained in SDK 14.1.0. Then a link error appeared - it seemed that I couldn't configure both of the ports simultaneously with DMA enabled respectively.

Please view this error message on the snapshotimage description:

I've been wondering whether both of the ports could work together with or without DMA enabled respectively. If the answer is positive, how should I tackle the error?

  1. Also, to avoid the error, I switched the SPI port to SPI1 and nothing *** took place again. Then some new issues befell me as I was measuring waveform on SPI1 port with a logic analyzer. I tried 4 combos for various SPI master modes and only one mode looked as normal as expected.

Please walk the records below:

I intended to send only one byte by truncating the string "Nordic....." in original source code to only "N"(0x4E) and then watch the display window of my logic analyzer.

1)ASYNC(having rx handler) + easyDMA enabled, two bytes captured-0x4E,0xFF. 2)SYNC(no rx handler) + easyDMA enabled, two bytes captured-0x4E,0xFF. 3)ASYNC(having rx handler) + easyDMA disabled, only onebytes captured-0x4E. 4)SYNC(no rx handler) + easyDMA enabled, the function "nrf_drv_spi_xfer" returned error code(-9).

Till now, I was really overwhelmed by the weird results - all these four cases were presumed to run correctly with no errors.

As a beginner, I don't know how to modify my source code to achieve the goal: both SPI0 master and twi0 master function correctly with DMA enabled respectively on nRF52832.

Is there anyone who can assist me to change my project per attached to make this happen?

Best regards. spi.zip

Related