Skip to content

Commit 4b59157

Browse files
committed
PicoSDK: Build STDIO components only if requested
1 parent 705e18f commit 4b59157

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

builder/frameworks/picosdk.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,16 +542,22 @@ def configure_printf_impl():
542542
("pico_runtime_init", "+<*>"),
543543
("pico_runtime", "+<*>"),
544544
("pico_status_led", "+<*>"),
545-
("pico_stdio_rtt", "+<*>"),
546-
("pico_stdio_semihosting", "+<*>"),
547-
("pico_stdio_uart", "+<*>"),
548-
("pico_stdio_usb", "+<*>"),
549545
("pico_stdio", "+<*>"),
550546
("pico_stdlib", "+<*>"),
551547
("pico_standard_binary_info", "+<*>"),
552548
("pico_unique_id", "+<*>"),
553549
]
554550

551+
# multiple stdio implementations can be on at the same time!
552+
if "LIB_PICO_STDIO_USB" in flags:
553+
default_common_rp2_components.append(("pico_stdio_usb", "+<*>"))
554+
if "LIB_PICO_STDIO_UART" in flags:
555+
default_common_rp2_components.append(("pico_stdio_uart", "+<*>"))
556+
if "LIB_PICO_STDIO_SEMIHOSTING" in flags:
557+
default_common_rp2_components.append(("pico_stdio_semihosting", "+<*>"))
558+
if "LIB_PICO_STDIO_RTT" in flags:
559+
default_common_rp2_components.append(("pico_stdio_rtt", "+<*>"))
560+
555561
if is_rp2350:
556562
default_common_rp2_components.extend(
557563
[

0 commit comments

Comments
 (0)