/* * Copyright (C) 2021 iosabi * Copyright (C) 2024 Gunar Schorcht * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ #pragma once /** * @ingroup pkg_esp32_sdk * @{ * * @file * @brief RIOT-OS modification of the bootloader SDK configuration * * The bootloader build of the ESP32 SDK needs some settings from the SDK * configuration. These are normally generated by the menuconfig in the vendor * SDK. * * Some of these parameters are configurable by the application. For example, * the UART baudrate used by the console and the verbose level of the * bootloader. * * @author iosabi * @author Gunar Schorcht */ #ifndef DOXYGEN #include "esp_idf_ver.h" #if defined(CPU_FAM_ESP32) # include "sdkconfig_default_esp32.h" #elif defined(CPU_FAM_ESP32C3) # include "sdkconfig_default_esp32c3.h" #elif defined(CPU_FAM_ESP32H2) # include "sdkconfig_default_esp32h2.h" #elif defined(CPU_FAM_ESP32S2) # include "sdkconfig_default_esp32s2.h" #elif defined(CPU_FAM_ESP32S3) # include "sdkconfig_default_esp32s3.h" #else # error "ESP32x family implementation missing" #endif #include "sdkconfig_default_common.h" #ifdef __cplusplus extern "C" { #endif #define CONFIG_BOOTLOADER_PROJECT_VER 1 #if MODULE_ESP_LOG_COLORED # define CONFIG_BOOTLOADER_LOG_COLORS 1 #endif #ifndef CONFIG_BOOTLOADER_LOG_LEVEL /* * SDK Log levels: * * 0 = NONE * 1 = ERROR * 2 = WARN * 3 = INFO * 4 = DEBUG * 5 = VERBOSE */ # if MODULE_ESP_LOG_STARTUP # define CONFIG_BOOTLOADER_LOG_LEVEL 3 /* INFO */ # else # define CONFIG_BOOTLOADER_LOG_LEVEL 0 /* NONE */ # endif #endif /** * Serial flasher config (defined by CFLAGS, only sanity check here) */ #if !defined(CONFIG_FLASHMODE_DOUT) && \ !defined(CONFIG_FLASHMODE_DIO) && \ !defined(CONFIG_FLASHMODE_QOUT) && \ !defined(CONFIG_FLASHMODE_QIO) # error "Flash mode not configured" #endif /* * Bootloader output baudrate, defined by the app settings as BAUD or * BOOTLOADER_BAUD. */ #define CONFIG_ESP_CONSOLE_UART_BAUDRATE (RIOT_BOOTLOADER_BAUD) /* * If custom TX and RX are defined, use custom UART configuration for 2nd stage * bootloader. */ #if defined(CONFIG_CONSOLE_UART_TX) && defined(CONFIG_CONSOLE_UART_RX) # define CONFIG_ESP_CONSOLE_UART_CUSTOM 1 # define CONFIG_ESP_CONSOLE_UART_TX_GPIO CONFIG_CONSOLE_UART_TX # define CONFIG_ESP_CONSOLE_UART_RX_GPIO CONFIG_CONSOLE_UART_RX #else # define CONFIG_ESP_CONSOLE_UART_DEFAULT 1 #endif #if defined(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_ROM_SERIAL_PORT_NUM CONFIG_ESP_CONSOLE_UART_NUM #define CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST 1 #ifdef __cplusplus } #endif #endif /* DOXYGEN */ /** @} */