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
  • It might be a good idea to check if you can send more than 257 bytes at the beginning of the main function before you begin scanning for BT devices.

    E.g.,

    int main(void)
    {
        bool erase_bonds;
        
        // Initialize.
        uart_init();
    
        uint32_t data_len = 512; 
        uint8_t dummy_byte = 'A';
    
        for (int i=0; i < data_len; i++)
        {
            uint32_t err_code = app_uart_put(dummy_byte);
            APP_ERROR_CHECK(err_code);
        }
        ...

Children
Related