nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51822 UART and BLE

Controller- MDBT40 (nrf51822 based)

Softdevice - S110

I have an application where data comes from UART and have to send over BLE simultaneously. When I initialize the BLE, the UART code gives unexpected behavior. But when I turn off the BLE, UART works fine. Could someone tell me is this because UART and BLE interrupts are triggered at the same time? If yes then how to change their priority.

Parents
  • Hi,

    The priorities of the softdevice are fixed, you are not able to change these, as the softdevice needs to handle strict timing requirements from the BLE specifications.

    See "Exception (interrupt) management with a SoftDevice" on page 54-55 in S110 SoftDevice Specification v2.0 for more details.

    If you need to receive data on UART while CPU is busy with BLE operations, you need to upgrade to a nRF52 series IC, which have UARTE peripherals with EasyDMA support, allowing you to send/receive data directly from/to RAM.

    Best regards,
    Jørgen

  • Hi,

    The correct approach would be to use the function sd_ble_gap_disconnect() and wait for the BLE_GAP_EVT_DISCONNECTED event. Note that the peripheral needs to start advertising when the Disconnected event is received, and the central needs to start scanning again when it wants to reconnect. It is not possible to initiate a connection from the central to the peripheral based on the address, if the peripheral is not advertising at the time.

    Best regards,
    Jørgen

Reply Children
No Data
Related