From 6403a229eb5ee27ccf2df76a688f6e786be2b892 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 19 Apr 2021 12:45:03 +0530 Subject: [PATCH 1/3] bootloader: fix print related to min. chip revision Closes https://github.com/espressif/esp-idf/issues/6890 Closes IDFGH-5106 --- components/bootloader_support/src/bootloader_common_loader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/bootloader_support/src/bootloader_common_loader.c b/components/bootloader_support/src/bootloader_common_loader.c index 3e8ddcf89d..687cf3ce15 100644 --- a/components/bootloader_support/src/bootloader_common_loader.c +++ b/components/bootloader_support/src/bootloader_common_loader.c @@ -77,7 +77,9 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd } uint8_t revision = bootloader_common_get_chip_revision(); if (revision < img_hdr->min_chip_rev) { - ESP_LOGE(TAG, "can't run on lower chip revision, expected %d, found %d", revision, img_hdr->min_chip_rev); + /* To fix this error, please update mininum supported chip revision from configuration, + * located in TARGET (e.g. ESP32) specific options under "Component config" menu */ + ESP_LOGE(TAG, "This chip is revision %d but the application is configured for minimum revision %d. Can't run.", revision, img_hdr->min_chip_rev); err = ESP_FAIL; } else if (revision != img_hdr->min_chip_rev) { #ifdef BOOTLOADER_BUILD From d41781099a4634dcda0fb95c46e9d385251cacc4 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Tue, 20 Apr 2021 14:22:14 +0530 Subject: [PATCH 2/3] bootloader_support: fix min. revision error print for < C3-ECO3 revisions --- .../bootloader_support/src/esp32c3/bootloader_esp32c3.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c index 427157a3f4..bc09658846 100644 --- a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c +++ b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c @@ -262,15 +262,15 @@ static void bootloader_super_wdt_auto_feed(void) REG_WRITE(RTC_CNTL_SWD_WPROTECT_REG, 0); } -#if CONFIG_ESP32C3_REV_MIN < 3 static inline void bootloader_hardware_init(void) { + // This check is always included in the bootloader so it can + // print the minimum revision error message later in the boot if (bootloader_common_get_chip_revision() < 3) { REGI2C_WRITE_MASK(I2C_ULP, I2C_ULP_IR_FORCE_XPD_IPH, 1); REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 12); } } -#endif static inline void bootloader_glitch_reset_disable(void) { @@ -285,9 +285,8 @@ static inline void bootloader_glitch_reset_disable(void) esp_err_t bootloader_init(void) { esp_err_t ret = ESP_OK; -#if CONFIG_ESP32C3_REV_MIN < 3 + bootloader_hardware_init(); -#endif bootloader_glitch_reset_disable(); bootloader_super_wdt_auto_feed(); // protect memory region From b24671e935f581008c9d9ae124cc802d5c5530d1 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Tue, 20 Apr 2021 11:48:00 +0530 Subject: [PATCH 3/3] test_apps: increase partition table offset to fix build errors --- .../system/bootloader_sections/sdkconfig.ci.flash_encryption | 1 + .../system/build_test/sdkconfig.ci.flash_encryption_release | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/test_apps/system/bootloader_sections/sdkconfig.ci.flash_encryption b/tools/test_apps/system/bootloader_sections/sdkconfig.ci.flash_encryption index 47e4a657c6..995fbdde26 100644 --- a/tools/test_apps/system/bootloader_sections/sdkconfig.ci.flash_encryption +++ b/tools/test_apps/system/bootloader_sections/sdkconfig.ci.flash_encryption @@ -1,2 +1,3 @@ CONFIG_SECURE_FLASH_ENC_ENABLED=y CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE=y +CONFIG_PARTITION_TABLE_OFFSET=0xA000 diff --git a/tools/test_apps/system/build_test/sdkconfig.ci.flash_encryption_release b/tools/test_apps/system/build_test/sdkconfig.ci.flash_encryption_release index 47e4a657c6..995fbdde26 100644 --- a/tools/test_apps/system/build_test/sdkconfig.ci.flash_encryption_release +++ b/tools/test_apps/system/build_test/sdkconfig.ci.flash_encryption_release @@ -1,2 +1,3 @@ CONFIG_SECURE_FLASH_ENC_ENABLED=y CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE=y +CONFIG_PARTITION_TABLE_OFFSET=0xA000