makefiles: filter stdio_default with STDIO_MODULES#22424
Conversation
Filtering only on `stdio_%` is too greedy, and will match several pseudomodules such as `stdio_available`. By moving the list of backends to a single source, the includsion of `stdio_default` can be filtered correctly.
crasbe
left a comment
There was a problem hiding this comment.
Note: I have tested this with tests/minimal when commenting out stdio_null in tests/minimal/Makefile on native.
It is very possible that some corner cases rely on the current order of resolution, but this would be the cleaner approach IMO.
Yes, there is no mechanism to select |
I wonder what the mechanism should be then, because currently This is on With the unmodified When commenting out => always For |
|
I have now moved the default stdio backend selection to Tested this again on the When squashing, I'll have to update the original commit message, since the description is not accurate anymore. |
|
So the issue with the failing boards is that there is no mechanism to add the However, the RIOT/boards/nucleo-g474re/Makefile.dep Lines 1 to 3 in c41d389 I haven't quite followed the mechanism why it worked before. This is the difference between But I found a fix: diff --git a/cpu/stm32/Makefile.dep b/cpu/stm32/Makefile.dep
index 188875ea8c..4ef714620b 100644
--- a/cpu/stm32/Makefile.dep
+++ b/cpu/stm32/Makefile.dep
@@ -29,6 +29,10 @@ ifneq (,$(filter periph_usbdev,$(FEATURES_USED)))
endif
endif
+# always require periph_uart when using periph_lpuart because they share code internally
+ifneq (,$(filter periph_lpuart,$(FEATURES_USED)))
+ FEATURES_REQUIRED += periph_uart
+endif
+
ifneq (,$(filter periph_uart_nonblocking,$(USEMODULE)))
USEMODULE += tsrb
endifWith this change, the |
Without this dependency, no stdio module will be selected. Because they depend on each other internally, it makes sense to add this dependency.
|
That seems to have done the trick! Time for and squash and a final test? |
|
I feel like this should be documented somewhere but I am also not too sure where exactly |
https://github.com/RIOT-OS/RIOT/blob/master/sys/stdio/doc.md Here? |
Let me propose something, on it. |
|
With a bit of help from Claude, I have come up with something for the documentation. |
crasbe
left a comment
There was a problem hiding this comment.
The static test has some complaints about trailing whitespaces.
| | Module | Description | | ||
| |:----------------------- |:-------------------------------------------------------- | | ||
| | `stdio_cdc_acm` | USB CDC ACM STDIO, see @ref usbus_cdc_acm_stdio | | ||
| | `stdio_ethos` | Ethernet-over-serial STDIO (legacy, see `ethos`) | |
There was a problem hiding this comment.
Today I learned we have an "Ethernet over Serial" module. That's quite awesome, if it was more documented :(
But that is unrelated to your PR
| | `stdio_tinyusb_cdc_acm` | USB CDC ACM STDIO on top of the tinyUSB stack | | ||
| | `stdio_uart` | UART STDIO, see @ref sys_stdio_uart | | ||
| | `stdio_udp` | UDP STDIO | | ||
| | `stdio_usb_serial_jtag` | USB serial/JTAG STDIO (e.g. on some ESP32 variants) | |
There was a problem hiding this comment.
| | `stdio_usb_serial_jtag` | USB serial/JTAG STDIO (e.g. on some ESP32 variants) | | |
| | `stdio_usb_serial_jtag` | USB Serial/JTAG STDIO (e.g. on some ESP32 variants) | |


Contribution description
Filtering only on
stdio_%is too greedy, and will match several pseudomodules such asstdio_availableorstdio_nimble_debug. By moving the list of backends to a single source, the inclusion ofstdio_defaultcan be filtered correctly.Noticed this while adding a new pseudomodule to the stdio module.
Testing procedure
Verify that
USEMODULE=stdio_available make -C examples/basic/hello-worldis not working (it does not print 'Hello World!' ).Then apply this patch, and verify that it does work.
Verified this to work on
native(defaults tostdio_native),sltb001a(defaults tostdio_uart) andpro-micro-nrf52840(defaults tostdio_cdc_acm).Issues/PRs references
None
Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are: