Skip to content

drivers/ethos: port to stdio_provider infrastructure - #22449

Draft
benpicco wants to merge 1 commit into
RIOT-OS:masterfrom
benpicco:drivers/ethos-stdio_provider
Draft

drivers/ethos: port to stdio_provider infrastructure#22449
benpicco wants to merge 1 commit into
RIOT-OS:masterfrom
benpicco:drivers/ethos-stdio_provider

Conversation

@benpicco

@benpicco benpicco commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Contribution description

It always bothered me a bit that stdio_ethos does not use the new stdio_provider infrastructure. 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 ethos over slipmux since we don't need Ethernet emulation over UART, SLIP will offer less overhead.

Testing procedure

I ran examples/networking/gnrc/border_router on same54-xpro, which defaults to ethos.

It did survive a ping -f while 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:

  • GitHub Copilot with Claude Sonnet 4.6 for porting the driver

@github-actions github-actions Bot added Area: build system Area: Build system Area: drivers Area: Device drivers labels Jul 6, 2026
@benpicco benpicco added the AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. label Jul 6, 2026
Comment thread drivers/ethos/ethos.c
#include "stdio_uart.h"
#include "isrpipe.h"
extern isrpipe_t ethos_stdio_isrpipe;
#include "stdio_base.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "stdio_base.h"
# include "stdio_base.h"

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 7, 2026
@riot-ci

riot-ci commented Jul 7, 2026

Copy link
Copy Markdown

Murdock results

✔️ PASSED

f1fd2af drivers/ethos: port to stdio_provider infrastructure

Success Failures Total Runtime
11124 0 11124 12m:07s

Artifacts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_stdioisrpipe 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 thread drivers/ethos/stdio.c
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 thread drivers/ethos/ethos.c
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(&ethos_stdio_isrpipe.tsrb);
/* signal to handler thread that frame is at an end (makes handler thread to
* truncate frame) */
isrpipe_write_one(&ethos_stdio_isrpipe, ETHOS_FRAME_DELIMITER);
#endif
break;
case ETHOS_FRAME_TYPE_ERRORED:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. Area: build system Area: Build system Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants