Hello, I think there's a bug in the app_uart library in SDK 10 that occurs when the FIFO is enabled.
Using SDK nRF51_SDK_10.0.0_dc26b5e, I was trying to write data to the UART as fast as possible in a loop with the baud rate set to 1M, to test the maximum throughput. The problem is that sometimes bytes were output from the UART out of order.
It looks like the problem is in app_uart_put in app_uart_fifo.c:
uint32_t app_uart_put(uint8_t byte)
{
uint32_t err_code;
tx_tmp = byte;
err_code = nrf_drv_uart_tx(&tx_tmp, 1);
if (err_code == NRF_ERROR_BUSY)
{
err_code = app_fifo_put(&m_tx_fifo, byte);
}
return err_code;
}
It's not checking if there are any bytes in the FIFO waiting to be sent, before it sends the byte to the UART driver directly. So if it's called in the time after the UART driver finishes sending the last byte, but before the event handler starts sending the next byte from the FIFO, then it will send the byte out of order.