Closed gauteh closed 2 years ago
What are you using to view the RTT output? At least probe-rs
has had general debugging issues in the past with programs that use wfi
. It has been fixed for some chips on the probe-rs side - it's not something that can be reasonably fixed in this library..
I solve this by using compile flags and defmt flush. I use both probe-rs and defmt-print over jlinkgdbserver. Latter doesn't have issues.
Issue can be closed.
I don't know about defmt
but this library at least does not have a buffer that needs to be flushed. J-Link software does the correct trickery to enable correct debugging with wfi
on STM32 chips (assuming you're using that because that's the chip family with problems), so that's probably what fixed it.
Using RTT with a program that sleeps a lot (wfi) seems to be very laggy and buggy. Maybe there could be a function that checks for debugger and wait for buffer to be flushed? Then I could manually call it before
wfi
to ensure output is sent.Haven't checked if defmt-rtt already does this.
https://forum.segger.com/index.php/Thread/6898-SOLVED-RTT-Output-Delayed-by-Deep-Sleep/