This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

app_uart_fifo, dma and buffers

Hello, I have some communication overflows on UART on nRF52, SDK 11 alpha, DMA active, big buffers (1024 bytes). I don't understand, nRF52 is not blocked in an interrupt and source is a poor 115200 bauds GPS.

When I look into SDK, DMA use 1 byte buffer. Am I right ? If it's correct what is the interrest of DMA ? Is there any DMA timeout like in some others CPU (call event hen enough bytes received or timeout elapsed) ?

Parents
  • Hi Fabien,

    I assume you are using the app_uart_fifo.c from SDK v11 alpha. If you are using the uart example included in the SDK, you should modify to increase UART_RX_BUF_SIZE to the size you want. It was default in the example configured to be 1, maybe that's the reason you got the overflow.

    The EasyDMA support multiple bytes buffer. When the easy DMA reached the number of max byte in buffer MAXCNT, you will receive ENDRX event.

    Note that the app_uart_fifo.c doesn't really take advantage of the EasyDMA feature (we are updating it) so if you want to really use EasyDMA, I would suggest to use the UARTE peripheral directly.

    But for normal use, as suggest above you can simply increase UART_RX_BUF_SIZE and you should be fine.

  • UART_RX_BUF_SIZE is not used for DMA but for FIFO, if you go deeper it use thèses 2 buffers.

    static uint8_t tx_buffer[1];
    static uint8_t rx_buffer[1];
    
Reply Children
No Data
Related