Closed JZJisawesome closed 9 months ago
I think this issue just came about because the initial value of the LSR register was randomized, so we sometimes thought data was available when in reality it wasn't. It also means the LCR was randomized and thus sometimes DLAB was set, replacing the LSR with the PSD and messing things up.
This lines up with the behaviour since it only happened with debug builds and only some of the time (for some seeds).
Implementing the LSR register with more accuracy appears to have resolved the issue on my personal/jzj/uartlinux
branch.
Sometimes, but not always, running
uart_read_test
has funky results.I only observe this sometimes, and only on debug (not on release) builds. This smells like some sort of timing issue with the read thread in the UART, or with
tsqueue.h
: