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

SPI Slave and BLE on nRF51822

Hi,

I'm trying to build a SPI Slave <-> BLE bridge, so that everything received over SPI bus is forwarded on BLE and vice versa. In order for the reverse direction to work, the master has to continously pull data from the nRF51822. The problem is that if the BLE part of the code is compiled in and running, the SPI bus just locks up after a random time, between 2 and 60 seconds depending on data rate). I'm using ARM mbed, and the SPISlave::receive() function, which is supposed to tell if any data has been received from the master, starts returning false after that time no matter what the master actually sends to it. My SPI settings are 1 MHz, 8 bit, mode 0.

I've found a couple of posts here about incompatibilities between the PPI and the BLE stack. (Here and here and here.) However it's not clear if what I'm trying to achieve is possible or not. Some comments say that a SPI clock below 2 MHz should have no bad effects. I'm using only 1 MHz. Another comment says this is a problem with the S110 SoftDevice. (Well, I don't know which SoftDevice I have, how can I check it?) There's a mention of "using SPI over the SoftDevice API" but no information how to actually do that. Do I have give up on mbed to use the SoftDevice API? Is SPIS and the BLE stack totally incompatible and hopeless to work together? Thanks!

Parents
  • Which mbed board are testing with ?

    Some of the thread you quoted was pretty old and may not relevant anymore. For example the CPU is no longer locked up when the radio is active. It's hard to tell what went wrong, I'm not very familiar with mbed and it's also harder to debug with mbed. I would suggest to post the question on mbed forum, in addition. And maybe you can try to export the mbed project to debug offline ?

    PPI and BLE should be fine as long as you don't use the PPI that the softdevice occupies.

    With the hardware we have, SPIS and BLE should work, worst case is that SPIS will clock out DEF when it can't access the memory.

Reply
  • Which mbed board are testing with ?

    Some of the thread you quoted was pretty old and may not relevant anymore. For example the CPU is no longer locked up when the radio is active. It's hard to tell what went wrong, I'm not very familiar with mbed and it's also harder to debug with mbed. I would suggest to post the question on mbed forum, in addition. And maybe you can try to export the mbed project to debug offline ?

    PPI and BLE should be fine as long as you don't use the PPI that the softdevice occupies.

    With the hardware we have, SPIS and BLE should work, worst case is that SPIS will clock out DEF when it can't access the memory.

Children
No Data
Related