drivers/ethos: port to stdio_provider infrastructure - #22449
Draft
benpicco wants to merge 1 commit into
Draft
Conversation
crasbe
reviewed
Jul 6, 2026
| #include "stdio_uart.h" | ||
| #include "isrpipe.h" | ||
| extern isrpipe_t ethos_stdio_isrpipe; | ||
| #include "stdio_base.h" |
Contributor
There was a problem hiding this comment.
Suggested change
| #include "stdio_base.h" | |
| # include "stdio_base.h" |
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the ethos stdio backend from the legacy stdio_* interface to RIOT’s stdio_provider infrastructure, so stdout (and stdin via stdin_isrpipe) integrates consistently with other stdio backends.
Changes:
- Switches ethos’ stdio implementation to
STDIO_PROVIDER(...)(provider-based stdio). - Updates ethos ISR handling to unescape TEXT frames in ISR and feed them into
stdin_isrpipe. - Simplifies stdio dependency resolution by removing legacy-backend special casing and always enabling
stdio.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| makefiles/stdio.inc.mk | Removes legacy stdio backend handling and always pulls in stdio module dependency logic. |
| drivers/ethos/stdio.c | Reworks ethos stdio backend into a stdio_provider with _init and _write. |
| drivers/ethos/Makefile.dep | Drops the old ethos_stdio → isrpipe dependency special case. |
| drivers/ethos/ethos.c | Routes TEXT frames into stdin_isrpipe and adjusts ISR unescaping behavior for TEXT frames. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+26
to
30
| static void _init(void) | ||
| { | ||
| isrpipe_write_one(arg, (char)data); | ||
| /* will be overwritten by netdev init, provide early stdout */ | ||
| uart_init(ETHOS_UART, ETHOS_BAUDRATE, NULL, NULL); | ||
| } |
Comment on lines
84
to
88
| tsrb_add_one(&dev->inbuf, ETHOS_FRAME_DELIMITER); | ||
| break; | ||
| case ETHOS_FRAME_TYPE_TEXT: | ||
| #ifdef MODULE_ETHOS_STDIO | ||
| tsrb_clear(ðos_stdio_isrpipe.tsrb); | ||
| /* signal to handler thread that frame is at an end (makes handler thread to | ||
| * truncate frame) */ | ||
| isrpipe_write_one(ðos_stdio_isrpipe, ETHOS_FRAME_DELIMITER); | ||
| #endif | ||
| break; | ||
| case ETHOS_FRAME_TYPE_ERRORED: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
It always bothered me a bit that
stdio_ethosdoes not use the newstdio_providerinfrastructure. For that it needs to unescape the text frames inside the ISR so it can write the data directly to the stdio isrpipe.For all practical purposes, there is no reason to use
ethosoverslipmuxsince we don't need Ethernet emulation over UART, SLIP will offer less overhead.Testing procedure
I ran
examples/networking/gnrc/border_routeronsame54-xpro, which defaults toethos.It did survive a
ping -fwhile doing stdio (with some lost frames on both stdio and ethernet)Issues/PRs references
Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are: