Skip to content

Commit eb77e1b

Browse files
committed
Merge branch 'bugfix/startup_secure_options' into 'master'
esp_system: fix compilation error when security features are enabled See merge request espressif/esp-idf!9678
2 parents f092054 + eff6a1e commit eb77e1b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

components/bootloader/Kconfig.projbuild

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ menu "Security features"
320320
select MBEDTLS_ECDSA_C
321321
depends on SECURE_SIGNED_ON_BOOT || SECURE_SIGNED_ON_UPDATE
322322

323+
config SECURE_TARGET_HAS_SECURE_ROM_DL_MODE
324+
bool
325+
default y
326+
depends on IDF_TARGET_ESP32S2
327+
323328

324329
config SECURE_SIGNED_APPS_NO_SECURE_BOOT
325330
bool "Require signed app images"
@@ -587,7 +592,7 @@ menu "Security features"
587592

588593
config SECURE_FLASH_ENCRYPTION_MODE_RELEASE
589594
bool "Release"
590-
select SECURE_ENABLE_SECURE_ROM_DL_MODE
595+
select SECURE_ENABLE_SECURE_ROM_DL_MODE if SECURE_TARGET_HAS_SECURE_ROM_DL_MODE
591596

592597
endchoice
593598

@@ -719,7 +724,7 @@ menu "Security features"
719724

720725
config SECURE_ENABLE_SECURE_ROM_DL_MODE
721726
bool "Permanently switch to ROM UART Secure Download mode"
722-
depends on IDF_TARGET_ESP32S2 && !SECURE_DISABLE_ROM_DL_MODE
727+
depends on SECURE_TARGET_HAS_SECURE_ROM_DL_MODE && !SECURE_DISABLE_ROM_DL_MODE
723728
help
724729
If set, during startup the app will burn an eFuse bit to permanently switch the UART ROM
725730
Download Mode into a separate Secure Download mode. This option can only work if

components/esp_system/startup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ static void IRAM_ATTR do_core_init(void)
229229
esp_flash_encryption_init_checks();
230230
#endif
231231

232+
esp_err_t err;
233+
232234
#if CONFIG_SECURE_DISABLE_ROM_DL_MODE
233235
err = esp_efuse_disable_rom_download_mode();
234236
assert(err == ESP_OK && "Failed to disable ROM download mode");
@@ -243,8 +245,6 @@ static void IRAM_ATTR do_core_init(void)
243245
esp_efuse_disable_basic_rom_console();
244246
#endif
245247

246-
esp_err_t err;
247-
248248
esp_timer_init();
249249
esp_set_time_from_rtc();
250250

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_SECURE_FLASH_ENC_ENABLED=y
2+
CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE=y

0 commit comments

Comments
 (0)