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

Error after transmit complete event in SPI + SoftDevice enabled

Hello,

I am really new to using the Nordic nRF51822 and I'm having problems making SPI work with the S110 SoftDevice. I was able to combine the sample codes spi_master_example and ble_app_hrs. I created some custom service and wish to read some data from a sensor over SPI when a certain data is sent to the Nordic chip over the custom service. All the BLE communication are working correctly, but once I send data over SPI to the sensor, the code gets stuck in the error handler. Before the code jumps to the error handler, I can receive the SPI_MASTER_EVT_TRANSFER_COMPLETED event indicating that the SPI transfer was a success. I can also see the data sent over SPI using an oscilloscope. But after the transfer complete event, the BLE no longer works and the system just hangs within the error handler.

I have tried reading everything about SPI in this forum, but I didn't find anything that can solve my problem. Has anybody encountered this problem previously? Any clues to solving it?

Is there a good sample code for using the SPI master peripheral together with the S110 SoftDevice? Most sample I found are for the I2C or UART. A good working SPI + S110 SoftDevice sample code will help greatly.

I followed the following information from the link https://devzone.nordicsemi.com/documentation/nrf51/6.0.0/s110/html/a00006.html to add the SPI support to the ble_app_hrs project.

Regards,

Leo

Related