File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
esp_system/port/soc/esp32c5 Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ static void esp_key_mgr_init(void)
5555
5656ESP_SYSTEM_INIT_FN (esp_security_init , SECONDARY , BIT (0 ), 103 )
5757{
58+ #if CONFIG_IDF_TARGET_ESP32C5
59+ // Check for unsupported configuration: flash encryption with CPU frequency > 160MHz
60+ // Manual encrypted flash writes are not stable at higher CPU clock.
61+ // Please refer to the ESP32-C5 SoC Errata document for more details.
62+ if (efuse_hal_flash_encryption_enabled () && CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ > 160 ) {
63+ ESP_EARLY_LOGE (TAG , "Flash encryption with CPU frequency > 160MHz is not supported. Please reconfigure the CPU frequency." );
64+ return ESP_ERR_NOT_SUPPORTED ;
65+ }
66+ #endif
67+
5868 esp_crypto_clk_init ();
5969
6070#if SOC_KEY_MANAGER_SUPPORT_KEY_DEPLOYMENT
Original file line number Diff line number Diff line change 11choice ESP_DEFAULT_CPU_FREQ_MHZ
22 prompt "CPU frequency"
33 default ESP_DEFAULT_CPU_FREQ_MHZ_40 if IDF_ENV_FPGA
4+ default ESP_DEFAULT_CPU_FREQ_MHZ_160 if SECURE_FLASH_ENC_ENABLED
45 default ESP_DEFAULT_CPU_FREQ_MHZ_240
56 help
6- CPU frequency to be set on application startup.
7+ CPU frequency to be set on application startup. For flash encryption enabled case,
8+ the default CPU frequency is 160MHz as the encrypted flash writes are not stable at
9+ higher CPU clock. Please see SoC Errata document for details.
710
811 config ESP_DEFAULT_CPU_FREQ_MHZ_40
912 bool "40 MHz"
@@ -13,6 +16,9 @@ choice ESP_DEFAULT_CPU_FREQ_MHZ
1316 config ESP_DEFAULT_CPU_FREQ_MHZ_160
1417 bool "160 MHz"
1518 config ESP_DEFAULT_CPU_FREQ_MHZ_240
19+ # Encrypted flash writes aren't supported at 240 MHz.
20+ # Please see SoC Errata document for details.
21+ depends on !SECURE_FLASH_ENC_ENABLED
1622 bool "240 MHz"
1723endchoice
1824
You can’t perform that action at this time.
0 commit comments