From 04cdc55efce806906bb32ff58a7c9da7d8e6e709 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 29 Nov 2022 10:41:56 +0530 Subject: [PATCH] esp_flash_encrypt: If it is supported then Enable secure download mode in release mode instead of disabling it completely. --- components/bootloader_support/src/flash_encrypt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/bootloader_support/src/flash_encrypt.c b/components/bootloader_support/src/flash_encrypt.c index 9405e5ac68..6624043780 100644 --- a/components/bootloader_support/src/flash_encrypt.c +++ b/components/bootloader_support/src/flash_encrypt.c @@ -204,7 +204,12 @@ void esp_flash_encryption_set_release_mode(void) ESP_LOGE(TAG, "Flash Encryption support not added, abort.."); abort(); #endif + +#if CONFIG_SOC_SUPPORTS_SECURE_DL_MODE + esp_efuse_enable_rom_secure_download_mode(); +#else esp_efuse_disable_rom_download_mode(); +#endif esp_efuse_batch_write_commit(); if (esp_get_flash_encryption_mode() != ESP_FLASH_ENC_MODE_RELEASE) {