-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(allwinner-d1): panic handling improvements #116
Conversation
This commit changes crowtty to attempt to decode any output that isn't in a SerMux frame as text. This lets us get panic output and other stuff, like `xfel`'s bootloader output. ![image](https://github.com/tosc-rs/mnemos/assets/2796466/6e818932-c97d-4261-8aef-6b92e70e3341)
✅ Deploy Preview for merry-scone-cc7a60 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
fn die() -> ! { | ||
loop { | ||
core::sync::atomic::fence(Ordering::SeqCst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge deal, but you could wfi loop here instead to not heat the CPU (it'll probably just never wake)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good call
} | ||
|
||
// TODO(eliza): abort any in-flight DMAs. | ||
|
||
// Ugly but works | ||
let mut uart: Uart = unsafe { core::mem::transmute(()) }; | ||
|
||
write!(&mut uart, "\r\n").ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want a null BEFORE as well, to force the end of the previous frame.
Additionally, you also probably want to either busy wait until the DMAC transfer is complete, or hard-stop any DMAC transfers that are ongoing, before manually driving the panic, otherwise I dunno how pushing bytes into the fifo while the DMAC is also doing it would go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i left a TODO about killing DMAC transfers. i intend to do that in a follow-up but will have to read the data sheet first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits are TIOLI, and feel free to defer any of the nice to haves for later PRs if you want to merge now.
This branch contains two commits:
feat(allwinner-d1): disable IRQs in panic
This commit changes the panic handler for the D1 to disable
interrupts, and adds a flag for tracking double panics. If we panic
inside the panic handler, we now just die immediately instead of
trying to print something.
feat(crowtty): try to decode loose utf8
This commit changes crowtty to attempt to decode any output that isn't
in a SerMux frame as UTF-8 text. This lets us get panic output without
having to do fancy COBS encoding in the panic handler. It also lets us
see other stuff, like
xfel
's bootloader output.For example: