"Failed to enter Flash download mode" with Encryption and Secure Boot on

Pandre4
Posts: 3
Joined: Tue Dec 13, 2022 4:09 pm

"Failed to enter Flash download mode" with Encryption and Secure Boot on

Postby Pandre4 » Wed Jan 18, 2023 3:18 pm

Hi,

In my software I have activated the Secure boot with a private signing key. I also activated Flash encryption with development or release mode, anyway. I am using UART ROM download mod (not recommended)).

After configuring everything in menuconfig, i can flash my ESP32-C3.

I start by burning the efuse with this command : "espefuse.py burn_key BLOCK_KEY0 /.../key_256.bin XTS_AES_128_KEY --do-not-confirm"
- Then I execute : " idf.py bootloader bootloader-flash flash"
- But, at the time of writing the last partition, the spiffs partition. I get an error that ends the execution of my order :
"A fatal error occured: Failed to enter Flash download mode (result was 01066430: Operation or feature not supported)"
- When I execute : "idf.py monitor", the Encryption and the Secure boot are installed correctly. And of course, in the log i see an error to mount spiffs partition.

So, to "reflash" spiffs partition I need to use this command :
"esptool.py -b 460800 --before default_reset --after no_reset --chip esp32c3 --no-stub write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x340000 build/spiffs.bin"
And it works.

This is my partition table knowing that spiffs and nvs are not encrypted :

nvs, data, nvs, , 0x8000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
ota_0, app, ota_0, , 0X190000,
ota_1, app, ota_1, , 0X190000,
spiffs, data, spiffs, , 0X30000,


Finally, is there way to avoid this fatal error ?

Thanks you for your help.

Paul

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Michaelboeding, mike_dawes and 84 guests