Skip to content
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

Write panic message to usb #109

Open
tyalie opened this issue Dec 11, 2021 · 3 comments
Open

Write panic message to usb #109

tyalie opened this issue Dec 11, 2021 · 3 comments

Comments

@tyalie
Copy link

tyalie commented Dec 11, 2021

This seems to be a feature request, that belongs into this repo.

But what would be awesome to have is that the panic handler can write over USB serial the message that was provided to it. Instead of just blinking the LED.

Is this possible?

@mciantyre
Copy link
Owner

Yup, it's possible. A simple approach is to optionally integrate the log crate into teensy4-panic. The panic handler writes the message at the error level. If the BSP's USB logging feature is enabled, the panic message is written over USB serial. #111 shows a proof of concept. This approach should also work with other logging implementations, like imxrt-uart-log.

After #95, we could consider other approaches that tightly integrate with the USB driver.

@Alexander89
Copy link
Contributor

I can't assign this to myself, but I will do this with the log crate.

I will add an optional feature to activate it. If nobody complaints, RP will follow soon 😄

@mciantyre
Copy link
Owner

#95 is closed, and the idea proposed in #111 still work with the new logger. Although I'm not planning to do anything fancier than #111 right now, I'll keep this open for users who want to talk about other approaches / features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants