From 2b1c5a86039a98a0e984d8a1bc87d721f873076e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 6 Nov 2023 14:40:05 +0000 Subject: [PATCH] boot: zephyr: serial_adapter: Fail if USB CDC enabled with console This prevents MCUboot from successfully building if console and serial recovery (USB CDC) are both enabled and they both point to the same device Signed-off-by: Jamie McCrae --- boot/zephyr/serial_adapter.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boot/zephyr/serial_adapter.c b/boot/zephyr/serial_adapter.c index d6be6857af..ac6ef91d76 100644 --- a/boot/zephyr/serial_adapter.c +++ b/boot/zephyr/serial_adapter.c @@ -29,7 +29,7 @@ #endif #if defined(CONFIG_BOOT_SERIAL_CDC_ACM) && \ - defined(CONFIG_UART_CONSOLE) && !DT_HAS_CHOSEN(zephyr_uart_mcumgr) + defined(CONFIG_UART_CONSOLE) && (!DT_HAS_CHOSEN(zephyr_uart_mcumgr) || DT_SAME_NODE(DT_CHOSEN(zephyr_uart_mcumgr), DT_CHOSEN(zephyr_console))) #error Zephyr UART console must been disabled if CDC ACM is enabled and MCUmgr \ has not been redirected to other UART with DTS chosen zephyr,uart-mcumgr. #endif @@ -199,7 +199,6 @@ boot_uart_fifo_getline(char **line) static int boot_uart_fifo_init(void) { - #if defined(CONFIG_BOOT_SERIAL_UART) #if DT_HAS_CHOSEN(zephyr_uart_mcumgr)