-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdio_rtt is loosing output #20510
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: