nRF52840 UART send more than 256 bytes

I'm sending some data from nRF52840 to another device through wired UART. When data is less than 256-byte long, it works fine. But when it's larger than 256 bytes, I get ERROR 4 [NRF_ERROR_NO_MEM]. I have already changed UART_TX_BUF_SIZE to 1024 in APP_UART_FIFO_INIT. Is there anything else I should change? Thanks

Parents Reply
  • Hello,

    When you initiate a debug session in your IDE, you can set a breakpoint at the app_uart_put() call and then single-step into the function. However, after examining the app_uart_put() implementation, I found that only the app_fifo_put() function can return NRF_ERROR_NO_MEM. This means the FIFO must be filling up faster than it's being emptied.

    I suggest you try to increase the TX buf size further to see if it helps. You may also consider using the UART driver or the Libuarte - advanced UARTE driver to allow you to work with larger DMA buffers (app_uart only allows sending of 1-byte at a time).

Children
Related