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

Use nrf_drv_uart.h or nrf_drv_uarte.h to allow a 921600 baud rate with double Rx buffer

I am willing to use the uart or uarte driver to be able to have to buffers for the Rx, I have a huge flow of data at high sped arriving to the UART, I have read for few days the forum, and could not find a tidy example that use the driver with aot the app_uart. But it is mentioned in many of them that is the only approach to be able to have to buffers of 256 bytes available to avoid loose of data. I have check the documentation in:

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fhardware_driver_uart.html&cp=4_0_0_2_0_19

But I am struggling to bring it in to my code. I am working in a team and the Uart was implemented for a colleague using the app_uart, but for some reason we are loosing between 6 to 20 bytes and seems is because the MCU is not able to handle the data arriving on time.

If you have a simple example (non of those in SDK 16 i found useful) would be really a help.

Thank you so much for your support

Best Regards,

Tomas

Parents Reply
  • We are trying to use the example, but we modify the handler to get the data from the 

    p_evt->data.rxtx.p_data,
    p_evt->data.rxtx.length,

    directly to an external buffer that is bigger, about 5000 bytes.

    Are we doing it wrongly? :

    case NRF_LIBUARTE_ASYNC_EVT_RX_DATA:
    for(i = 0; i < p_evt->data.rxtx.length; i++)
            {
                 _iwr6843_sensor_dataTom[i + nextpoint] = *(p_evt->data.rxtx.p_data+i);
                                        
            }

    We are getting the software stuck when trying to stop the uart and do other process in the main like simple print the data in _iwr6843_sensor_dataTom, it shows:

    Any Ideas for what we could be handling wrong?

Children
No Data
Related