nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

BLE disconnected while using virtual UART and HW_UART

Hello,

In my project i am using nrf52840 and i have change the default UART pins to P1.3 (TX) and P1.4(RX) and while using virtual UART like BLE UART  i mean in the sense sending data from the APP TO MCU and vice versa here at the same time if  i am trying to use the HW_UART BLE gets disconnected.

1. why its happening like this.??

2. Please suggest me to resolve this.

thank you.

Parents Reply
  • Hello Susheel,

    thanks for the reply, 

    You need to check how you are handling this error from the uart. If this is an overrun error, then it happens more frequently when you are not using any HW flow control.

    In the uart_init() i have enabled the HW_flow_control aslo but no use still its happening like this.

    i think in the uart_event_handler() i am trying to receive sensor data sometimes uart_communication error will raised so what exactly happening and receiving a sensor data is a problem or any other issues.??

    thank you.

Children
  • depends on what error it is.
    You can check the source of the error when using app_uart like below in the uart callback handler

            case APP_UART_COMMUNICATION_ERROR:
                APP_ERROR_HANDLER(p_event->data.error_communication);

    If using nrfx drivers, you can directly get and clear the errorsrc usingnrfx_uarte_errorsrc_get. Based on the type of error you get, you can handle that error as per the application need (for example, flush the RX FIFO or restart the uart communication etc)

    .

Related