Merge branch 'bugfix/bootloader_custom_rtc_data_crc_v5.1' into 'release/v5.1'

fix(bootloader): add legacy retained memory CRC calculation (backport v5.1)

See merge request espressif/esp-idf!28936
This commit is contained in:
Jiang Jiang Jian
2024-02-27 20:00:55 +08:00
2 changed files with 16 additions and 1 deletions

View File

@@ -122,7 +122,7 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
static uint32_t rtc_retain_mem_size(void) {
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
#if CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC && !CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_IN_CRC
/* A custom memory has been reserved by the user, do not consider this memory into CRC calculation as it may change without
* the have the user updating the CRC. Return the offset of the custom field, which is equivalent to size of the structure
* minus the size of everything after (including) `custom` */