Files
esp-idf/components/esp_bootloader_format/esp_bootloader_desc.c
Konstantin Kondrashov 8913d4cf61 fix(esp_bootloader_format): Remove bootloader description from app build
The removed function `esp_bootloader_get_description` never worked in the app build.
It can be used only in the bootloader build.

To read the bootloader description from app, there is another function
`esp_ota_get_bootloader_description`.
2026-07-10 12:17:59 +03:00

39 lines
1.0 KiB
C

/*
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <assert.h>
#include <sys/param.h>
#include "esp_bootloader_desc.h"
#include "sdkconfig.h"
// Bootloader version info
__attribute__((section(".data_bootloader_desc")))
__attribute__((weak))
const esp_bootloader_desc_t esp_bootloader_desc = {
.magic_byte = ESP_BOOTLOADER_DESC_MAGIC_BYTE,
.reserved = { 0 },
#if CONFIG_BOOTLOADER_ANTI_ROLLBACK_ENABLE
.secure_version = CONFIG_BOOTLOADER_SECURE_VERSION,
#else
.secure_version = 0,
#endif // CONFIG_BOOTLOADER_ANTI_ROLLBACK_ENABLE
.version = CONFIG_BOOTLOADER_PROJECT_VER,
.idf_ver = IDF_VER,
#ifdef CONFIG_BOOTLOADER_COMPILE_TIME_DATE
.date_time = __DATE__ " " __TIME__,
#else
.date_time = "",
#endif
.reserved2 = { 0 },
};
_Static_assert(sizeof(IDF_VER) <= sizeof(esp_bootloader_desc.idf_ver), "IDF_VER is longer than idf_ver field in structure");
const esp_bootloader_desc_t *esp_bootloader_get_description(void)
{
return &esp_bootloader_desc;
}