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

NRF UART Error at Higher Baud Rate

My requirement is to send from Controller Device to NRF Ble Device through UART of 40Bytes at the rate of less than 1ms. Currently I am using ble_app_uart example as a reference.  

According to Nordic forum UART/UARTE Not able to handle data well at higher Baud Rate. The Overrun Error occurs because of the Byte by Byte data receiving mechanism.

Nordic SDK: 17.0.2

So My question as follows:

1. By using UART/UARTE Can i achieve 921600 or higher baud rate.  

2. If not why? Please send me a reason.

3. If Yes. Please send me a reference.

By Referring the Nordic Forum i get to know by using libuarte-advanced UARTE driver I can achieve higher baud rate. Is this Correct.

So My question as follows:

1. Is 921600 baud rate achievable.

2.  Please send me a Integration Guide with BLE Peripheral Examples(eg,. ble_app_uart).

 3. If there send me a ble peripheral example with libuarte for my refernce.

  • Hi Pavan, 

    Do you know the configuration of the peer UART device? Does it have the HWFC enabled? If not, that could one of your issues here.

    If you see overrun errors even with the HWFC enabled  o both ends then it seems that the peer UART is sending data too fast. By the the time nRF UART can toggle the CTS pin, the peer UART is already sending few bytes overruning the FIFO in the uart. This depends on many factors and the speed with with your application is pulling data from the RX FIFO plays a major role in it.

     

    Pavan Kote said:
    6. How to use EasyDMA with double buffering with "nrf_drv_uart" driver or "NRFX_UART" driver .

     you need to enable UARTE in your config file and the test in the source file is done as below, so you need to enable atleast NRF_UARTE_ENABLED and one of the NRFX_UARTEX_ENABLED

    #if NRFX_CHECK(NRFX_UARTE_ENABLED)
    
    #if !(NRFX_CHECK(NRFX_UARTE0_ENABLED) || \
          NRFX_CHECK(NRFX_UARTE1_ENABLED) || \
          NRFX_CHECK(NRFX_UARTE2_ENABLED) || \
          NRFX_CHECK(NRFX_UARTE3_ENABLED))
    #error "No enabled UARTE instances. Check <nrfx_config.h>."
    #endif

  • Hi Susheel,

    The HWFC Enabled in Peer UART Device.

     

  • Then try reducing the baudrate as it seems your application is not able to handle reception at that high speeds.  Overrun error can still happen at these high baudrate when the peer is still sending data during the time when nRF is still pulling the CTS high.

  • Till 250K Baud rate it's ok. I am receiving data nicely.

    But according to our requirement we have to send data from Controller UART to BLE Module UART and send data through BLE within a span of 1msec.

    If we configured our UART 1M it will send 40 bytes of data in 200 microsec. the BLE send process will took around 600 micro sec.

    I change the UART Interrupt priority also.

    Is it radio priority and interrupt priority clashes or While radio event or within the time of connection interval(7.5ms) is it blocking UART interrupt.  

  • What is the MTU size? that decides on many bytes are sent in one connection event. (X bytes/7.5ms)

    how much processing time is spent before and sending data (Y us)

    Application+uart driver latency on every byte transaction on UART (Z us). How many bytes per transaction best suites for your application when using EasyDMA?

    It is the architect of your software who needs to consider /benchmark and fine tune these perameters and these are different for every application. It is not possible from us at the techsupport to give you a general answer on this.

     

    Pavan Kote said:
    If we configured our UART 1M it will send 40 bytes of data in 200 microsec. the BLE send process will took around 600 micro sec.

    Here it looks like BLE overhead to process and send 40 btyes of data is 200+600 = 800us.

    If you can also benchmark the UART bytes overhead (by commenting out the BLE part, or even better disable the softdevice just for benchmarking UART purpose) then you can clearly get some numbers on maximum throughput you can achieve combinging UART and BLE for your usecase.

    The RADIO interrupt will be highest priority when using softdevice.

Related