Hi everyone,
thanks in advance for your help!
I’m facing a situation where I need to enable Flash Encryption on an ESP32 project, specifically to protect the partition that contains keys and passwords. Everything works fine when Flash Encryption is active from the beginning.
However, the problem is that I already have many devices deployed in the field — connected and running — that don’t have Flash Encryption enabled (efuses are not set and bootloader is not compatible).
If I compile the firmware with CONFIG_SECURE_FLASH_ENC_ENABLED=y, it crashes on those devices at boot because the encryption efuse is not set.
I can’t maintain two separate firmware builds (one for new devices, one for legacy ones), because OTA management would become too complex and error-prone — a single mistake could permanently brick a device.
Do you have any suggestions on how to handle this cleanly?
Would it be safe to:
Compile the firmware with CONFIG_SECURE_FLASH_ENC_ENABLED=n, and
On new devices, enable flash encryption manually by writing the efuses during initial flashing?
That way, the firmware could check at runtime using esp_flash_encryption_enabled() and decide whether to access encrypted data or not.
Any best practices or alternative strategies are very welcome.
Thanks again and have a great day!
Managing Flash Encryption for devices already in the field
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Qwantbot and 2 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!