I have a personal project using tinyusb to expose a CDC device and an HID device. I wanted to reimplement the read, write, and open newlib syscalls, but looking through the source code of pico_stdio, I noticed that I would not be able to just copy their implementation, as stdio_get_until and stdio_put_string are static and thus private functions to the stdio.c source file. So I just reimplemented the syscalls using my own output routines... and started seeing my application crash, as printf and putchar were being wrapped by the pico-sdk and sending the input data through pico_stdio. pico_set_printf_implementation(${name} compiler) almost does what I want, but it only manages the functions defined in pico_printf, which excludes putchar. The current pico-sdk is missing something similar for pico_stdio.
I tried using SKIP_PICO_STDIO, but that completely avoids the entire library including includes, which blows up other dependencies of pico_stdlib.
I have a PR I'll place momentarily that does what I want by borrowing exactly what pico_printf does, requiring the use of a cmake property to change the default stdio library.
I have a personal project using tinyusb to expose a CDC device and an HID device. I wanted to reimplement the
read
,write
, andopen
newlib syscalls, but looking through the source code ofpico_stdio
, I noticed that I would not be able to just copy their implementation, asstdio_get_until
andstdio_put_string
are static and thus private functions to thestdio.c
source file. So I just reimplemented the syscalls using my own output routines... and started seeing my application crash, asprintf
andputchar
were being wrapped by the pico-sdk and sending the input data throughpico_stdio
.pico_set_printf_implementation(${name} compiler)
almost does what I want, but it only manages the functions defined inpico_printf
, which excludesputchar
. The current pico-sdk is missing something similar forpico_stdio
.I tried using
SKIP_PICO_STDIO
, but that completely avoids the entire library including includes, which blows up other dependencies ofpico_stdlib
.I have a PR I'll place momentarily that does what I want by borrowing exactly what
pico_printf
does, requiring the use of a cmake property to change the default stdio library.