sys: stdio_null: add null driver#10741
Conversation
|
I don't understand. Why not just exclude the |
|
That produces the following error (using origin/master): There is a hard dependency on |
Is it possible to remove that dependency instead? |
Probably. But I don't know the impact on existing applications. First of all, To me, this optional driver is similar to telling an application to write to It's a self-contained alternative. Otherwise we would have to do a lot of |
"I have a branch(tm)". Disabling stdio completely needs some ground work. I'll start PR'ing. |
Ok, right. As an optional alternative I am fine with this approach. Nevertheless, we should investigate if an alternative without any dependency to |
Well, one way is to use +1 for adding this, even if the only user is the bootloader on EFM32. |
04f15bd to
43adad8
Compare
|
I added commit to #9258 (this one) that provides this same functionality, but without adding a null driver. Instead I intercept read() and write() (actually, the reentrant versions). I think it is important to be honest about the fact that it is a stub and set error codes appropriately. Space savings are similar, but I need to rebase my branch on top of yours to do a proper comparison. |
|
Personally I think that we should look at working on a full solution rather than a quick fix, unless this is urgently needed by anyone other than @basilfx ... |
|
I would need it to get the boot loader fit. We could also replace it later on. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
|
@basilfx would you rebase pls? |
43adad8 to
103a50d
Compare
|
@kaspar030 Done! I also updated the PR description after retesting. Still seems to work ;-) |
Could you add this module to tests/minimal, so it is actually compiled at least somewhere? |
or to riotboot? |
830c695 to
2dff32c
Compare
|
Added it to basilfx:minimal/ (feature/stdio_null) $ BOARD=samr21-xpro make -j8
Building application "tests_minimal" for "samr21-xpro" with MCU "samd21".
"make" -C boards/samr21-xpro
"make" -C core
"make" -C cpu/samd21
"make" -C drivers
"make" -C sys
"make" -C cpu/cortexm_common
"make" -C cpu/sam0_common
"make" -C cpu/samd21/periph
"make" -C drivers/periph_common
"make" -C sys/newlib_syscalls_default
"make" -C sys/pm_layered
"make" -C cpu/cortexm_common/periph
"make" -C cpu/sam0_common/periph
"make" -C sys/stdio_null
text data bss dec hex filename
2236 16 2524 4776 12a8 tests/minimal/bin/samr21-xpro/tests_minimal.elf |
|
I'll create a separate PR (#12744) to isolate that last commit. |
dc96484 to
2dff32c
Compare
|
#12768 has just been merged so Murdock should pass now (I retriggered it). |
2dff32c to
05bdab8
Compare
|
Rebased. Murdock is happy. I think the comments by @smlng have been resolved some time ago already :-) |
aabadie
left a comment
There was a problem hiding this comment.
Looks good and the CI is green. Let's go with this one.
ACK and go!
Contribution description
This PR provides a null driver for STDIO, so that it doesn't depend on UART or RTT.
I created this to test #10215, where the bootloader easily exceeds the default 4KiB on EFM32 targets, because due to
periph_uartstill being included (which includes other big stuff). With this null driver, I could save an additional 2KiB. This makes sense for something like a bootloader, but anything that depends on reading from UART will break.I've added a warning with
DEVELHELP=1, because I assume you enabled it to show some output.It took me five minutes to create, so if this doesn't make any sense, that I don't feel bad ;-)
Testing procedure
Add
USEMODULE=stdio_nullto any application to see what it saves. In particular, add this tobootloaders/riotboot/Makefileand observe thattests/riotbootstill works.Here is an example for
tests/minimal.As usual:
With
USEMODULE=stdio_null:With
DEVELHELP=1 USEMODULE=stdio_null:Issues/PRs references
#9503
#10215