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

Softdevice with SPI: Rx Byte replaced with 0x00

I have a program running with SD 7.2 and SPI on my nrF51822 talking to a SPI slave device. I use GPIOTE triggered on an edge to set a chip select line and read bytes from the slave. I do not use Timer 0 or PPI for my SPI implementation.

The method works perfectly without softdevice, but when I brought it into my BLE application the second byte I receive always seems to be 0 when I transfer a value from the SPI RX buffer to an inline declared byte array. I break before saving the second byte to a temp. variable and the RX buff shows it is non-zero. But after the assignment, I see 0x00 stored into the temp. variable. I return on receiving 0 and have observed this when letting my program run free as well.

I checked against the SD resource specifications and it does not seem like anything I am doing should conflict with the softdevice. Am I missing anything critical?

Parents
  • I believe I identified my issue. I use GPIOTE to trigger a notification that I need to select an SPI slave but I am using a polling method to capture bytes over SPI instead of an interrupt driven method. Before I used SD the timer could run without problems. With SD, I may be able to get a couple messages alright, but the softdevice will eventually conflict and screw up my app if it takes control during a polled transfer.

Reply
  • I believe I identified my issue. I use GPIOTE to trigger a notification that I need to select an SPI slave but I am using a polling method to capture bytes over SPI instead of an interrupt driven method. Before I used SD the timer could run without problems. With SD, I may be able to get a couple messages alright, but the softdevice will eventually conflict and screw up my app if it takes control during a polled transfer.

Children
No Data
Related