You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stdio_rtt is convenient because of its speed and because it does not block any peripheral. However, it is basically useless in tests as it will loos output written to the ringbuffer right before the main thread exists.
More than once I spent time tracing down non-existing bugs as the app appeared to be stuck, while in fact it ran to completion and succeeded but the last few lines of output where never flushed.
Steps to reproduce the issue
Run any test app with stdio_rtt and OpenOCD. I had this with the nucleo-f429zi and the e180-zg120b-tb; but given that the issue affected 2 out of 2 random boards, I think it applies generally.
Expected results
No output is lost, unless writing faster than OpenOCD can drain the ringbuffer.
Actual results
The last bytes written to stdio are lost. Adding simple fflush() or similar doesn't solve the issue, but adding some while (1) {puts("."); ztimer_sleep(ZTIMER_MSEC, 100);} or similar to add more output results in the relevant output to be written.
Maybe this is also specific to the interaction between OpenOCD and stdio_rtt and jlink is a bit more eager in extracting data?
Versions
Current master, but the issue is not new.
The text was updated successfully, but these errors were encountered:
Description
stdio_rtt
is convenient because of its speed and because it does not block any peripheral. However, it is basically useless in tests as it will loos output written to the ringbuffer right before the main thread exists.More than once I spent time tracing down non-existing bugs as the app appeared to be stuck, while in fact it ran to completion and succeeded but the last few lines of output where never flushed.
Steps to reproduce the issue
Run any test app with
stdio_rtt
and OpenOCD. I had this with thenucleo-f429zi
and thee180-zg120b-tb
; but given that the issue affected 2 out of 2 random boards, I think it applies generally.Expected results
No output is lost, unless writing faster than OpenOCD can drain the ringbuffer.
Actual results
The last bytes written to
stdio
are lost. Adding simplefflush()
or similar doesn't solve the issue, but adding somewhile (1) {puts("."); ztimer_sleep(ZTIMER_MSEC, 100);}
or similar to add more output results in the relevant output to be written.Maybe this is also specific to the interaction between OpenOCD and
stdio_rtt
andjlink
is a bit more eager in extracting data?Versions
Current
master
, but the issue is not new.The text was updated successfully, but these errors were encountered: