aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Brown <[email protected]>2025-02-28 09:00:53 -0700
committerDario Nieuwenhuis <[email protected]>2025-04-07 00:56:24 +0200
commitc6e16c9e4e64aefff5d40935587433f4e9718fb5 (patch)
tree262fe52517332e6a22ea127eb68e54ef4377c828
parent717fbc1cd9a038d6601721a6e84f58be264ee624 (diff)
embassy-rp: uart: Increase RX FIFO watermark
Change the UART RX FIFO depth from 1/8 to 7/8. This should allow for buffered receipt of uart data with a lower IRQ load. The PL011 fifo is pretty smart about the fifo, it has an automatic timeout (which triggers an interrupt) of about 4 characters worth of time, so setting this threshold doesn't affect the behavior of receipt of a partially filled fifo. This should not have any affect on the DMA mode, as the DMA will generally drain the fifo as data becomes available. The constraint for the fifo threshold should be determined by expected interrupt latency. The IRQ needs to be able to drain the fifo before it fills. As such, the proper threshold depends on system design and data rate. At full speed (7.8 Mbaud), the remaining 8 characters will come in in about 10us, which is probably insufficient. But, the time is quite adequate at lower speeds.
-rw-r--r--embassy-rp/src/uart/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs
index 90c7655be..7ce074a3f 100644
--- a/embassy-rp/src/uart/mod.rs
+++ b/embassy-rp/src/uart/mod.rs
@@ -913,7 +913,7 @@ impl<'d, T: Instance + 'd, M: Mode> Uart<'d, T, M> {
913 }); 913 });
914 914
915 r.uartifls().write(|w| { 915 r.uartifls().write(|w| {
916 w.set_rxiflsel(0b000); 916 w.set_rxiflsel(0b100);
917 w.set_txiflsel(0b000); 917 w.set_txiflsel(0b000);
918 }); 918 });
919 919