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

Can I use UART in BLE service ?

Hello everyone , can i use UART which is not a services or characteristic in bluetooth low energy . It will result in some question or bad effection? By the way . why I cannot use sd_nvic_EnableIRQ(UART0_IRQn) function instead NVIC_EnableIRQ(UART0_IRQn) function in bluetooth service ?

  • I'm having a little trouble understanding exactly what you ask about, but there isn't any major problems with using UART while in a BLE connection. However, what you need to be aware of is the fact that the CPU is blocked for each connection event, and this can possibly cause lost bytes on the UART interface if hardware flow control is not used, or if the other end keeps sending bytes after RTS has been raised.

    As for the sd_* API functions, these are only usable while the softdevice is enabled. These should most definitely be usable from a Bluetooth service. Do you see them returning any error codes if they don't work? As with all softdevice API functions, you should make sure to store the error code, and verify that it succeeds.

Related