From 9e62e32a5b4cd40bc17508670e303c2b3ecf3dee Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 25 Mar 2024 12:22:51 +0800 Subject: [PATCH] fix(system_console): fixed unity output not working with usb jtag serial --- components/bootloader_support/src/bootloader_console.c | 7 +++++++ .../test_apps/console/sdkconfig.ci.serial_jtag_only | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/bootloader_support/src/bootloader_console.c b/components/bootloader_support/src/bootloader_console.c index 0e8f2697bb..0de00bb51c 100644 --- a/components/bootloader_support/src/bootloader_console.c +++ b/components/bootloader_support/src/bootloader_console.c @@ -126,5 +126,12 @@ void bootloader_console_init(void) void bootloader_console_init(void) { esp_rom_output_switch_buffer(ESP_ROM_USB_SERIAL_DEVICE_NUM); + + /* Switch console channel to avoid output on UART and allow */ + esp_rom_output_set_as_console(ESP_ROM_USB_SERIAL_DEVICE_NUM); + + /* ROM printf by default also prints to USB-Serial-JTAG on channel 2 + need to disable to not print twice */ + esp_rom_install_channel_putc(2, NULL); } #endif //CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG diff --git a/components/esp_system/test_apps/console/sdkconfig.ci.serial_jtag_only b/components/esp_system/test_apps/console/sdkconfig.ci.serial_jtag_only index 31d8b93cc9..0ed159f5c9 100644 --- a/components/esp_system/test_apps/console/sdkconfig.ci.serial_jtag_only +++ b/components/esp_system/test_apps/console/sdkconfig.ci.serial_jtag_only @@ -1,3 +1,3 @@ CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y # Disabled due to semihosting issue IDF-9574 -CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=n \ No newline at end of file +CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=n