-
Notifications
You must be signed in to change notification settings - Fork 178
Add semihosting and SWO examples to mbed_override_console(). #1063
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
Conversation
@TeroJaasko semihosting example in docs. |
docs/api/platform/FileHandle.md
Outdated
} | ||
``` | ||
|
||
Then any program using `printf` on that target sends its output over the SWO, rather than serial. It is also possible to redirect the console by using semihosting which enables the console logs to be captured by a debugger: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above example's text was talking about the case where a target is using SerialWireOutput.
Both the new examples are probably/definitely the case where the developer/application is deciding to redirect. (The semihosting would crash without debugger attached, so it's probably only a temporary thing by the developer, and the other one is talking about the target default not being suitable).
So those two should be overriding mbed_override_console
, and/or maybe the text should be shuffled a bit. Otherwise you'd have a horrible collision in the case where the target had the SerialWireOutput
override above, and you tried to override to semihosting.
In an out-of-the-box Mbed OS, the WEAK target
defaults may or may not be already overridden by the target's support code - they're reserved for target code.
The WEAK non-target
defaults are always ready to be overridden by application code on any target. Or some libraries may offer an option to do the override for you - eg "esp8266.provide_default".
We could have platform.localfilesystem.provide_default_console
or something to provide this example behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good good, I'll update this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it makes sense to me, I was initially using the wrong mbed_target_override_console()
in my main.cpp
. I juggled the text around to better support this new understanding.
@kjbracey-arm any comments?
|
Make minor copy edits, mostly for active voice.
Is this relevant to both 5.12 and 5.13? |
|
Add semihosting and SWO examples to mbed_override_console() by applying changes from PR #1063
Related to ARMmbed/mbed-os#10553