On Mon, Jul 6, 2020 at 7:12 PM Nathan Hartman <hartman.nat...@gmail.com> wrote: > > On Mon, Jul 6, 2020 at 9:48 PM Brennan Ashton <bash...@brennanashton.com> > wrote: > > > The EOS S3 SOC unfortunately seems to have very limited interrupt > > support for the UART peripheral. The TX interrupt is limited to when > > the tx fifo reaches certain levels of full and does not seem to have a > > FIFO "empty" interrupt which is what the serial driver expects. I was > > wondering if there are any other examples for handling this beyond a > > worker to periodically check if the FIFO can take more data? > > > I don't know about this micro in particular but I've found that when UARTs > support DMA, that usually works much better than interrupts. Micros I've > used from different vendors have had hardware errata related to the UART > interrupts where they come at the wrong time or just unreliably, and the > workaround I've often seen suggested is to use DMA. >
Unfortunately there does not appear to be DMA support for the UART. There are some test registers for it, so I suspect the original IP supported it and then it got cut off. I don't think the worker thread would be too bad since I can control if it runs via the txint and there is a FIFO (depth 8 I think) so it only has to wake up some fraction of the baud rate and notify the serial driver to fill the fifo with uart_xmitchars. This way we can play it a little loose with the timing while usually keeping up with the baudrate and not using a timer. There is DMA for a lot of the sensor interfaces as well as doing transfers with the logic fabric, I suspect the UART just is more of a debug tool than a peripheral that is expected to see much real use. --Brennan