feat(bootloader): Adds bootloader anti rollback configs

This commit is contained in:
Konstantin Kondrashov
2024-06-29 15:48:51 +03:00
parent bb329c4e53
commit 816a0da0fd
5 changed files with 34 additions and 1 deletions
@@ -17,6 +17,11 @@ __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
@@ -24,7 +24,8 @@ extern "C"
*/
typedef struct {
uint8_t magic_byte; /*!< Magic byte ESP_BOOTLOADER_DESC_MAGIC_BYTE */
uint8_t reserved[3]; /*!< reserved for IDF */
uint8_t reserved[2]; /*!< reserved for IDF */
uint8_t secure_version; /*!< The version used by bootloader anti-rollback feature */
uint32_t version; /*!< Bootloader version */
char idf_ver[32]; /*!< Version IDF */
char date_time[24]; /*!< Compile date and time*/