NRF52833 uart use 921600 baud NRF_DRV_UART_EVT_ERROR

HI 

        I use SDK 17.0.0 in NRF52833.I test uart by example project  ,the dir is \examples\peripheral\uart\pca10100\blank\arm5_no_packs .

       Modify the baud to 921600 ,and send data to 52833 by serial software. If send data less than 52 bytes,serial software can received the send data from 52833.But send data more than 52 bytes,the serial software not receive any data.By debug,the uart gererated the interrupt  NRF_DRV_UART_EVT_ERROR and enter  uart_error_handle.And  if generate the interrupt  NRF_DRV_UART_EVT_ERROR,52833 not receive all data.

        How to solve this problem?

   

Parents Reply Children
  • Hi 

    Thanks for the additional details. This corresponds to the overrun error, which happens when the UART receive buffers are not updated fast enough. 

    It seems very odd that this should happen after just receiving 52 bytes. 

    Have you made any changes to the peripheral example, or are you just running the example out of the box?

    As a general note there is a more flexible and powerful UART driver in the nRF5 SDK called nrf_libuarte, which you might also want to consider. There is an example showing how to use this in the peripheral folder. 

    Best regards
    Torbjørn

  • Hi

        For the example project, only the baud rate is modified. The nrf_libuarte test is OK.

        Can the UART project be optimized?

  • Hi 

    I think I will have to try and reproduce the issue on my end, so I can see if there is something wrong with the example. 

    If I understand you correctly all I have to do to test this is to change the baudrate to 921600, and try to send a message longer than 52 bytes to the board?

    Best regards
    Torbjørn

  • You might correct the baud rate divisor in use for 921600 baud, as in the nRF52833 v1.5 datasheet and SDK  v17.1.0 it is incorrect; such a big error (over 2%) can by itself accumulate to generate framing and/or overrun errors. The correct value (my calculation) is below:

    // Quoted values from nRF52833 v1.5 datasheet - "No" means incorrect
    //
    //  --------Calculated-------------------  ---------------Documentation---------------
    //  Required Register      Actual   Error  Register    Required   Actual  Error   Ok?
    //  ======== =========== ======== =======  =========== ======== ======== =======  ====
    //   921600, 0x0EBEE000,  921600, +0.000%  0x0F000000,  921600,  941176, +2.124%,  No,

  • Hi  

        I think the deviation  of baud rate can't cause the problem,because the libuarte project in example project  use 921600 baud is OK.I think the problem is caused by not receiving in time

Related