makefiles: Select suitable terminal when stdio_rtt is used #18528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
When stdio_rtt is used, the default value of RIOT_TERMINAL (pyterm) with some PORT makes little sense -- the board won't be using that.
Instead, when stdio_rtt is detected, the selected PROGRAMMER is introspected, and the used to pick the corresponding terminal transport.
Testing procedure
microbit-v2
, and an example that has nice shell (eg.saul
)make -C examples/saul BOARD=microbit-v2 all flash term
(Note that this is identical to that of #18526 except that no RIOT_TERMINAL is set).
I've tried this with PROGRAMMER values of openocd and pyocd (for which RTT is not implemented, falling back to the pyterm default but issuing a warning); I'd appreciate if someone who uses JLink could test it with that too.
Issues/PRs references
Follow-up for #18526, based on a comment @benpicco left there.