diff --git a/platform/mbed_lib.json b/platform/mbed_lib.json index 4878af50a7..1e74bf2ef6 100644 --- a/platform/mbed_lib.json +++ b/platform/mbed_lib.json @@ -12,12 +12,12 @@ }, "stdio-buffered-serial": { - "help": "Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.", + "help": "(Applies if target.console-uart is true.) Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.", "value": false }, "stdio-baud-rate": { - "help": "Baud rate for stdio", + "help": "(Applies if target.console-uart is true.) Baud rate for stdio", "value": 9600 }, diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index 3683646994..5a6a041327 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -261,7 +261,7 @@ MBED_WEAK FileHandle *mbed::mbed_override_console(int fd) static FileHandle *default_console() { -#if DEVICE_SERIAL +#if MBED_CONF_TARGET_CONSOLE_UART && DEVICE_SERIAL # if MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); # if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS @@ -274,7 +274,7 @@ static FileHandle *default_console() # else static DirectSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); # endif -#else // DEVICE_SERIAL +#else // MBED_CONF_TARGET_CONSOLE_UART && DEVICE_SERIAL static Sink console; #endif return &console; diff --git a/targets/targets.json b/targets/targets.json index 1fac9465cd..00e0ce863d 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -15,6 +15,10 @@ "bootloader_supported": false, "static_memory_defines": true, "config": { + "console-uart": { + "help": "Target has UART console on pins STDIO_UART_TX, STDIO_UART_RX. Value is only significant if target has SERIAL device.", + "value": true + }, "console-uart-flow-control": { "help": "Console hardware flow control. Options: null, RTS, CTS, RTSCTS.", "value": null