diff --git a/cpu/esp32/include/periph_cpu.h b/cpu/esp32/include/periph_cpu.h index f813dfeefc..e90f857e4f 100644 --- a/cpu/esp32/include/periph_cpu.h +++ b/cpu/esp32/include/periph_cpu.h @@ -32,6 +32,11 @@ extern "C" { #endif +/** + * @brief UART device used for STDIO + */ +#define STDIO_UART_DEV CONFIG_ESP_CONSOLE_UART_NUM + /** * @name Power management configuration * @{ diff --git a/cpu/esp32/include/sdkconfig.h b/cpu/esp32/include/sdkconfig.h index e412962ab8..d7a91d0d5d 100644 --- a/cpu/esp32/include/sdkconfig.h +++ b/cpu/esp32/include/sdkconfig.h @@ -55,15 +55,15 @@ /** * Default console configuration * - * STDIO_UART_BAUDRATE is used as CONFIG_CONSOLE_UART_BAUDRATE and + * STDIO_UART_BAUDRATE is used as CONFIG_ESP_CONSOLE_UART_BAUDRATE and * can be overridden by an application specific configuration. */ -#define CONFIG_CONSOLE_UART_NUM 0 -#define CONFIG_ESP_CONSOLE_UART_NUM CONFIG_CONSOLE_UART_NUM - -#ifndef CONFIG_CONSOLE_UART_BAUDRATE -#define CONFIG_CONSOLE_UART_BAUDRATE STDIO_UART_BAUDRATE +#ifdef CONFIG_CONSOLE_UART_NUM +#define CONFIG_ESP_CONSOLE_UART_NUM CONFIG_CONSOLE_UART_NUM +#else +#define CONFIG_ESP_CONSOLE_UART_NUM 0 #endif +#define CONFIG_ESP_CONSOLE_UART_BAUDRATE STDIO_UART_BAUDRATE /** * Log output configuration (DO NOT CHANGE) diff --git a/cpu/esp32/startup.c b/cpu/esp32/startup.c index 344bbae44b..9455f4033a 100644 --- a/cpu/esp32/startup.c +++ b/cpu/esp32/startup.c @@ -148,7 +148,7 @@ static NORETURN void IRAM system_startup_cpu0(void) #endif /* initialize stdio */ - esp_rom_uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + esp_rom_uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); stdio_init(); RESET_REASON reset_reason = rtc_get_reset_reason(PRO_CPU_NUM); @@ -315,7 +315,7 @@ static NORETURN void IRAM system_init (void) /* starting RIOT */ #if IS_USED(MODULE_ESP_LOG_STARTUP) LOG_STARTUP("Starting RIOT kernel on PRO cpu\n"); - esp_rom_uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + esp_rom_uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); #else puts(""); #endif