knurling-rs / defmt

Efficient, deferred formatting for logging on embedded systems
https://defmt.ferrous-systems.com/
Apache License 2.0
750 stars 69 forks source link

defmt_rtt::flush implementation does not work with `probe-rs` #818

Open Urhengulas opened 4 months ago

Urhengulas commented 4 months ago

I just realized that probe-rs does not set RTT to blocking, at least that is how I understand the documentation (link). While this is generally good, this means the defmt-rtt cannot detect that probe-rs is connected and therefore the flush implementation does not work anymore.

https://github.com/knurling-rs/defmt/blob/ae2d0dff82014e334d6c2480cb59b95682408ff5/firmware/defmt-rtt/src/channel.rs#L103-L106

Any ideas how to detect it otherwise?

bugadani commented 3 months ago

I think it's a clever enough idea and we can configure channels to blocking in probe-rs if we can prove they are defmt-related up channels.

Urhengulas commented 3 months ago

I think it's a clever enough idea and we can configure channels to blocking in probe-rs if we can prove they are defmt-related up channels.

That's a good idea