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

Problems with UART in 52840

I am using a code similar to App_uart_C from SDK17.02 - central sending data over uart to another peripheral.

After 30-60 sec, the operation stops probably due to an error in the UART and I need to reset the chip

How can I handle UART errors ? I don't mind loosing data - but I cannot stay with the software crashing

Thanks

Avi

Parents
  • Hi,

    It does not sound like a very reliable way to resolve the issue with a delay, and this could also increase the current consumption of your device.

    If you can explain where the error occurs, and what the error is, I can help you find a better solution. If the chip "stops", it is most likely ending up in the error handler, because an error code was passed to APP_ERROR_CHECK() macro, and you have built the application in debug mode. You do not have to pass all error codes to this macro, it is fully up to you how you handle an error. For instance, if you get a NRF_ERROR_NO_MEM error from a call to app_uart_put(), you can filter this error and tell your application to retry the operation at a later point.

    Best regards,
    Jørgen

  • Have you considered adding HWFC pins to the UART in your application? If you are not able to process the FIFO fast enough, the incoming stream of data may overflow the UART, causing an error.

    You can try to remove the APP_ERROR_CHECK in APP_UART_FIFO_ERROR case in uart_event_handle(). This will ignore any OVERRUN/PARITY/FRAMING/BREAK errors from the UART peripheral, which may lead to data loss.

    case APP_UART_FIFO_ERROR:
        //APP_ERROR_HANDLER(p_event->data.error_code);
        break;

  • I cannot use the HWFC since my ext processor doesn't support it.

    I removed the //APP_ERROR_HANDLER(p_event->data.error_code);

    And still the transfer is stuck after few seconds (about 1000 lines of 15 chars each).

    The only way to recover is via hard reset

Reply Children
Related