mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-08 04:56:43 +00:00
I wrote in a commit yesterday how there was no ROI on doing this yet somehow I kept on doing it. I blame poor impulse control. Turns out there was a series of race conditions and bugs that caused this thing to "mostly work" on the first go at it but really hard to debug and get very right. 1. Litex UART has a weird undocumented API. You advance the Rx FIFO by writing `1` to the PENDING bit, and no other way. However, you determine if there are any more characters to receive by reading the EMPTY bit and seeing if it is 1. The previous method wrote `1` to the PENDING bit and then used the PENDING bit to see if a character was available, under the theory that the PENDING bit would be set again if there was still a character. This is somewhat true, except that the PENDING bit is set only some amount of time later which is about comparable to a few CPU instructions, so if you had a fast loop path the PENDING bit would show as cleared and you'd exit, which would cause no further interrupts to fire because the interrupt was effecitvely not acknowledged. This isn't written up anywhere but I figured this out by just reading the source code for Litex UART and BIOS: |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
| shellchat_screen1.png | ||
Shell Chat
shellchat is the basic command line environment for Precursor. It houses most of the system
maintenanence and test commands.
If you'd like to make your own REPL-type app, check out apps/repl/ for a pared-down version of
shellchat which is a better starting point.