feat: defmt-over-RTT debug build + probe-rs flow
Add an opt-in `defmt` feature that swaps panic-reset for panic-probe, links defmt-rtt, and enables hsmc's `trace-defmt` so chart transitions print over RTT. Default builds are unchanged (still panic-reset, no defmt overhead). - Cargo.toml: `defmt` feature pulls defmt + defmt-rtt + panic-probe and forwards `trace-defmt` to hsmc; mirror-flag pattern matches the existing `embassy` feature. - build.rs: link `defmt.x` only when the feature is on. - src/main.rs: cfg-gate the panic handler swap, log boot, USB serial, kbd/mouse wake completion vs. deadline, and jiggle dx/dy. - main.rs: watchdog.pause_on_debug(true) so probe-rs halts don't trip the 8 s reset. - justfile: build-debug, debug, attach, probes recipes (release mode — debug builds overflow flash with defmt+panic-probe). - mise.toml: add cargo:probe-rs-tools.
This commit is contained in:
@@ -9,4 +9,11 @@ fn main() {
|
||||
println!("cargo:rustc-link-search={}", out.display());
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
|
||||
// defmt ships its own linker script (`defmt.x`) that defines the
|
||||
// `_defmt_*` interner sections. Only link it when the feature is on —
|
||||
// otherwise the symbols don't exist and `ld` will refuse the build.
|
||||
if env::var_os("CARGO_FEATURE_DEFMT").is_some() {
|
||||
println!("cargo:rustc-link-arg=-Tdefmt.x");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user