UART RX double buffering

Hi Nordic experts,

I'm working for Particle Inc. We are using nRF52840 on our dev boards (Argon / Boron / etc.). We are experiencing a UART RX data lost issue using a single buffer for receiving. We designed our own UART driver that is independent from the nrfx driver. See the soure code for your reference: https://github.com/particle-iot/device-os/blob/develop/hal/src/nRF52840/usart_hal.cpp. Here I'd like your official suggestion about the UART RX path: whether double buffering is the best approach to avoid RX data lost. We have created a PR to refactored our driver to use double buffering for RX path: https://github.com/particle-iot/device-os/pull/2685

Any suggestion would be really appreciated.

Best regards,

Guohui

Parents
  • Hi

    I'm sorry, but we can't do reviews of custom drivers as we won't be liable for any drivers developed outside of our R&D team and review process I'm afraid. Additionally we're not too many used to working with C++, so you might not get the most thorough review of a C++ driver.

    Regarding the UART RX buffering, we do not use double buffering in our driver, but you're welcome to implement it on your end to improve data loss, although it should not be necessary. The most common cause for data loss in the buffers is the buffers not being large enough or the UART transmitting more data than the receiver is able to process, thus eventually overflowing buffers eventually no matter the size if you don't give it time to do only processing now and then.

    Best regards,

    Simon

Reply
  • Hi

    I'm sorry, but we can't do reviews of custom drivers as we won't be liable for any drivers developed outside of our R&D team and review process I'm afraid. Additionally we're not too many used to working with C++, so you might not get the most thorough review of a C++ driver.

    Regarding the UART RX buffering, we do not use double buffering in our driver, but you're welcome to implement it on your end to improve data loss, although it should not be necessary. The most common cause for data loss in the buffers is the buffers not being large enough or the UART transmitting more data than the receiver is able to process, thus eventually overflowing buffers eventually no matter the size if you don't give it time to do only processing now and then.

    Best regards,

    Simon

Children
No Data
Related