feat: report the panic site over MIDI - #637
Draft
kosmar wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: needs a decision against #632 first — see "Interaction with #632" below.
When Core 1 aborts, the device still looks healthy. Core 0 keeps USB enumerated
and the MIDI clock ticking, so the only symptom is that app notes stop. Without
a debug probe attached there is no way to find out where it died.
This replaces
panic-probewith a small handler that logs the panic site overdefmt (as before, minus the message text) and records
file/linefor a Core-0task, which re-sends them as CCs on MIDI channel 16 once per second. A plain MIDI
capture then carries the panic site.
scripts/decode-panic-beacon.pymaps thefile hash back to a path.
This is how the Core-1 abort behind the recent "app goes silent after a few
notes" reports was located: the beacon pointed straight at the offending line.
Size: 951,900 bytes of flash vs 949,408 on main, so +2,492 bytes. Dropping
panic-probesaves about 20 KiB; keeping a defmt line for probe users spendsmost of it back.
Interaction with #632
#632 sets
panic = "immediate-abort", which compiles the#[panic_handler]away and makes this beacon inert. The two are not textually in conflict (this
branch does not touch
Cargo.tomlor.cargo/config.toml), but they pull inopposite directions and want sequencing:
panic = "abort"to do anything, which givesback the flash fix: support current Rust toolchains #632 saves.
Worth deciding whether post-mortem visibility without a probe is worth a
non-immediate abort. Happy to close this if the answer is no.
Note:
cargo clippyon current nightly fails onmidi.rs:520(chunks_exact)on main as well; #632 fixes that.
Test plan
arrive on channel 16 once per second.
scripts/decode-panic-beacon.pyagainst the capture and confirm it printsthe correct file and line.
Made with Cursor