1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 18:13:49 +01:00
RIOT/cpu/esp32/bootloader/sdkconfig.h
2025-09-12 11:25:41 +02:00

122 lines
2.9 KiB
C

/*
* SPDX-FileCopyrightText: 2021 iosabi
* SPDX-FileCopyrightText: 2024 Gunar Schorcht
* SPDX-License-Identifier: LGPL-2.1-only
*/
#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 <iosabi@protonmail.com>
* @author Gunar Schorcht <gunar@schorcht.net>
*/
#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_ESP32C6)
# include "sdkconfig_default_esp32c6.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 */
/** @} */