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

ble getting disconnected during data transmission

I have developed a code for transferring data through uart to ble. It is working properly. but when I add a line printf to my code the data transmission stops and ble will disconnected. This part is crucial for me since once the connection is established printf is sending an acknowledgement to send the data to UART from the computer. I have added the screenshot of the same. Without printf it will work. But I need this for acknowledgement. I tried app_uart_put too. 

Parents
  • One possible cause: Your ble event handler is running in interrupt context, and the UART interrupt cannot preemt it. This causes printf() to never return (deadlock).

    Possible solutions or workarounds: Run uart in higher (read: lower numerical value) priority.

    Or call the printf() from main loop (e.g. using a flag variable,  "Schedule handling library").

Reply
  • One possible cause: Your ble event handler is running in interrupt context, and the UART interrupt cannot preemt it. This causes printf() to never return (deadlock).

    Possible solutions or workarounds: Run uart in higher (read: lower numerical value) priority.

    Or call the printf() from main loop (e.g. using a flag variable,  "Schedule handling library").

Children
No Data
Related