From a25bfbc6158048a678ff3cd62d708acf31c40790 Mon Sep 17 00:00:00 2001 From: Andrew Kohlsmith Date: Thu, 18 Dec 2025 21:36:56 -0800 Subject: [PATCH 1/2] remove guards that disable sdio_usb when tinyusb_host is linked in; it works just fine --- src/rp2_common/pico_stdio_usb/reset_interface.c | 3 --- src/rp2_common/pico_stdio_usb/stdio_usb.c | 7 ------- 2 files changed, 10 deletions(-) diff --git a/src/rp2_common/pico_stdio_usb/reset_interface.c b/src/rp2_common/pico_stdio_usb/reset_interface.c index 26afa3de1..d87397c03 100644 --- a/src/rp2_common/pico_stdio_usb/reset_interface.c +++ b/src/rp2_common/pico_stdio_usb/reset_interface.c @@ -7,8 +7,6 @@ #include "pico/bootrom.h" -#if !defined(LIB_TINYUSB_HOST) - #if PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE && !(PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL || PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT) #warning PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE has been selected but neither PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL nor PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT have been selected. #endif @@ -187,4 +185,3 @@ void tud_cdc_line_coding_cb(__unused uint8_t itf, cdc_line_coding_t const* p_lin } #endif -#endif \ No newline at end of file diff --git a/src/rp2_common/pico_stdio_usb/stdio_usb.c b/src/rp2_common/pico_stdio_usb/stdio_usb.c index 61aa7089b..a5029bacb 100644 --- a/src/rp2_common/pico_stdio_usb/stdio_usb.c +++ b/src/rp2_common/pico_stdio_usb/stdio_usb.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef LIB_TINYUSB_HOST #include "tusb.h" #include "pico/stdio_usb.h" @@ -301,10 +300,4 @@ bool stdio_usb_init(void) { return false; } #endif // CFG_TUD_ENABLED && CFG_TUD_CDC -#else -#warning stdio USB was configured, but is being disabled as TinyUSB host is explicitly linked -bool stdio_usb_init(void) { - return false; -} -#endif // !LIB_TINYUSB_HOST From 6664a89382a4640bfc2bdddd53ddd1ed092c3097 Mon Sep 17 00:00:00 2001 From: Andrew Kohlsmith Date: Fri, 19 Dec 2025 15:29:32 -0800 Subject: [PATCH 2/2] implement better guards --- src/rp2_common/pico_stdio_usb/reset_interface.c | 3 ++- src/rp2_common/pico_stdio_usb/stdio_usb.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/pico_stdio_usb/reset_interface.c b/src/rp2_common/pico_stdio_usb/reset_interface.c index d87397c03..061320936 100644 --- a/src/rp2_common/pico_stdio_usb/reset_interface.c +++ b/src/rp2_common/pico_stdio_usb/reset_interface.c @@ -5,6 +5,7 @@ */ #include "tusb.h" +#if !defined(LIB_TINYUSB_HOST) || (defined(LIB_TINYUSB_HOST) && defined(CFG_TUH_RPI_PIO_USB)) #include "pico/bootrom.h" #if PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE && !(PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_BOOTSEL || PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_RESET_TO_FLASH_BOOT) @@ -184,4 +185,4 @@ void tud_cdc_line_coding_cb(__unused uint8_t itf, cdc_line_coding_t const* p_lin } } #endif - +#endif // !defined(LIB_TINYUSB_HOST) || (defined(LIB_TINYUSB_HOST) && defined(CFG_TUH_RPI_PIO_USB)) diff --git a/src/rp2_common/pico_stdio_usb/stdio_usb.c b/src/rp2_common/pico_stdio_usb/stdio_usb.c index a5029bacb..bbff5f612 100644 --- a/src/rp2_common/pico_stdio_usb/stdio_usb.c +++ b/src/rp2_common/pico_stdio_usb/stdio_usb.c @@ -5,6 +5,8 @@ */ #include "tusb.h" + +#if !defined(LIB_TINYUSB_HOST) || (defined(LIB_TINYUSB_HOST) && defined(CFG_TUH_RPI_PIO_USB)) #include "pico/stdio_usb.h" // these may not be set if the user is providing tud support (i.e. LIB_TINYUSB_DEVICE is 1 because @@ -300,4 +302,10 @@ bool stdio_usb_init(void) { return false; } #endif // CFG_TUD_ENABLED && CFG_TUD_CDC +#else +#warning stdio USB was configured, but is being disabled as TinyUSB host is explicitly linked and is not using PIO-USB +bool stdio_usb_init(void) { + return false; +} +#endif // !defined(LIB_TINYUSB_HOST) || (defined(LIB_TINYUSB_HOST) && defined(CFG_TUH_RPI_PIO_USB))