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

Custom error handler for cli

In this file: components/libraries/cli/uart/nrf_cli_uart.c

The function as defined:

static void uart_error_handle(app_uart_evt_t * p_event)
{
    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);
    }
}

Totally strips out the error type to the point that a custom error handler:

__WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)

Is unable to determine the original evt_type and thus unable to handle / ignore errors on an evt_type basis.

What's the normal way of overriding uart_error_handle()?

Or... is there a way to handle APP_UART_COMMUNICATION_ERROR and APP_UART_FIFO_ERROR differently in app_error_fault_handler()?

Parents Reply Children
Related