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

Serial port abstraction layer api : handling error

Hi.

I'm working with both custom board based on nrf52840 and nrf52840-dk.

I just moved from the app_uart api to the abstract serial api.

I have noticed that when an error occurs the api does not pass on the event error src as it appears in the uart0\1 registers.

Why ? i also seen that it appears that after the retrieval of the error the code resets the error code so even if i access it myself it's not going to have the value.

So using the serial abstraction api, when a driver error occurs, how am i to get the actual error code that caused the issue ?

  • Hi,

    You can get the error mask in the UART driver handler in nrf_serial (in the NRF_DRV_UART_EVT_ERROR case), it is stored in p_event->data.error.error_mask. However, there are currently no ways to pass it along to the event handler for the serial library in the application.

    Best regards,
    Jørgen

  • disappointing... i started using the serial abstraction layer by copying it and modifying the code for my needs. i was also surprised that the code is not working well with rx buffer the size of 1 the hw rx buffer reaches overflow really fast. while it is logical to have rx buffer at least the size of 2 since most devices will not send just '\n' or one byte it is possible, but if so then the code in nrfx_urte will not call the handler. but for the strange code in nrfx_urte i'll post another question.

Related