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

Does simple_uart example buffer?

I've been playing with the simple_uart example and it seems like it might be missing responses. Does it buffer incoming data until the simple_uart_get() is called?

Parents
  • There are no buffering in simple_uart itself, but there is a 2-byte (6-byte on latest chip revision) buffer in the hardware itself. If this buffer is overflowed, the OVERRUN field of the ERRORSRC register in the UART peripheral will be set, so you can check for this condition.

    If you have hardware flow control enabled, this should also reduce the possibility for this happening, but some peer devices may send enough data to overflow the 2-byte buffer, even when the nRF51822 is signaling that it is not ready. The 6-byte buffer was therefore introduced to cope with such devices, and with this buffer size, hardware flow control should completely remove this problem.

Reply
  • There are no buffering in simple_uart itself, but there is a 2-byte (6-byte on latest chip revision) buffer in the hardware itself. If this buffer is overflowed, the OVERRUN field of the ERRORSRC register in the UART peripheral will be set, so you can check for this condition.

    If you have hardware flow control enabled, this should also reduce the possibility for this happening, but some peer devices may send enough data to overflow the 2-byte buffer, even when the nRF51822 is signaling that it is not ready. The 6-byte buffer was therefore introduced to cope with such devices, and with this buffer size, hardware flow control should completely remove this problem.

Children
No Data
Related