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

ble and spi in nrf52

hello , I am working spi with softdevice(i.e., bluetooth). here spi master is nrf52 and spi slave is ad9837. the spi interface code works fine without soft device(i.e.,ble) but with softdevice and I am integrate that code to "ble_app_uart" example code but the "nrf_drv_spi_transfer" function is not able to send the data& the error that i am getting is "NRF_ERROR_BUSY". so can any one please suggest me how to use spi interface with softdevice.

note:here spi code contains 6 types of data which is send by 6 times using "nrf_drv_spi_transfer" function but the first data send successfully after that I am getting same error for remaining 5 times the error is "NRF_ERROR_BUSY".

Parents
  • I'm assuming you're calling nrf_drv_spi_transfer() SIX times. If that's the case, you're calling "nrf_drv_spi_transfer" too fast. You don't let the previous transfer finish before you start another.

    I'm not sure what you mean by "6 types of data", but you can just put all of your data in a larger tx_buffer, and then pass its pointer to the nrf_drv_spi_transfer(). That way you would only need to use nrf_drv_spi_transfer() ONE time.

    You could also write your nrf_drv_spi_transfer() functions in the spi handler(). The handler will run whenever a transfer is complete, so by having your functions in there, you avoid any transfer() overlap.

Reply
  • I'm assuming you're calling nrf_drv_spi_transfer() SIX times. If that's the case, you're calling "nrf_drv_spi_transfer" too fast. You don't let the previous transfer finish before you start another.

    I'm not sure what you mean by "6 types of data", but you can just put all of your data in a larger tx_buffer, and then pass its pointer to the nrf_drv_spi_transfer(). That way you would only need to use nrf_drv_spi_transfer() ONE time.

    You could also write your nrf_drv_spi_transfer() functions in the spi handler(). The handler will run whenever a transfer is complete, so by having your functions in there, you avoid any transfer() overlap.

Children
No Data
Related