knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
644 stars 75 forks source link

Support for viewing defmt RTT logs without resetting device #354

Open cstrahan opened 1 year ago

cstrahan commented 1 year ago

Hello,

Is there a means (or would be possible to add support) for a way to view defmt logs while a micro controller is already running (i.e. without resetting it first)? My current use case looks something like:

Logs here would be a big help.

I can do probe-run target/thumbv6m-none-eabi/debug/pim --no-flash --chip rp2040, which doesn't flash the device, but it does reset it. It would help in this sort of scenario if I could view the defmt logs without resetting the device.

I guess such a feature contradicts the "run" in the name probe-run, but unless there's already another executable that provides this ability, it would be really nice to have. Or if this is a fundamental limitation of defmt/probe-run, it would be nice to have an advisory in the docs (assuming I haven't overlooked such).

Thanks!

cstrahan commented 1 year ago

Here's where I've described how to use defmt with cargo-embed: https://github.com/probe-rs/probe-rs/discussions/1237#discussioncomment-3727155

Still would be cool for probe-run to support this, as (at the very least) I really like the unique features probe-run has like colorization for the various log components (making it easier to spot log level, file names, etc) and support for full back traces.

whitequark commented 1 year ago

https://github.com/knurling-rs/probe-run/pull/414