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

UART Rx operation is not working

When I try to receive data from terminal at that time it can not goes in uart_error_handle() function and data is not received.

Which macros are enabled in sdk_config.h file for data reception.

void uart_error_handle(app_uart_evt_t * p_event)
{
    uint32_t err_code;
    uint8_t gb;
//     printf("%d",p_event->data.value);
    if (p_event->evt_type == APP_UART_DATA_READY)
    {
       while(app_uart_get(&gb) != NRF_SUCCESS);
    }
    if (p_event->evt_type == APP_UART_TX_EMPTY)
    {
//        app_uart_put();
    }
//    if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR)
//    {
//        APP_ERROR_HANDLER(p_event->data.error_communication);
//    }
//    else if (p_event->evt_type == APP_UART_FIFO_ERROR)
//    {
//        APP_ERROR_HANDLER(p_event->data.error_code);
//    }
}

  • Hi.

    Maybe you could add some more information about what you have done, which SDK you are working with, which device you are working with?

    You mention that you are trying to receive data from the terminal but you are seeing some error when you do that.
    What kind of error are you seeing?

    Did you start with the UART example from our SDK? Have you made any modifications to this example? Because this should work out of the box using our example.

    Best regards,
    Joakim Jakobsen

Related