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

Serial FIFO sizes acting as the bottleneck

Hello,

When I try to read data from UART RX port using serial library, I'm not able to read the data beyond the number specified by 

SERIAL_FIFO_TX_SIZE and SERIAL_FIFO_TX_SIZE which is 32. How to avoid this?

I don't think just increasing it would be a solution because I should be able to read the incoming bytes continuously without any stoppage at any point in time.

Parents
  • Hi,

    When setting up the UART library and driver, you typically provide buffers of some size (typically the library will have a large buffer, while the driver have a small buffer where the UART hardware module can write&read data directly to&from RAM). The application will be interrupted when there is data that can be read out. Typically the amount of data that can be read out is fixed to the size of the UART hardware buffer in such case, this may be a problem if you need to receive data of a dynamic size.

    To overcome this I guess there are alternative ways, but one way that does not stop any potential ongoing transactions may be just to read the RAM location where the UART hardware module is writing data directly. To know where the UART hardware module is currently writing data you can use NRF_UARTE0->RXD.PTR, the hardware module will fill up the RAM from this location until NRF_UARTE0->RXD.MAXCNT.

  • Thanks for the explanation Kenneth!

    Is there a way where I can read the data then stop the uart rx, flush the queues and again re enable rx when I want to read the data?

Reply Children
Related