How to reflash encrypted firmware again after plain text firmware downloaded mistakenly into encrypted flash.

draval
Posts: 3
Joined: Fri May 14, 2021 3:18 pm

How to reflash encrypted firmware again after plain text firmware downloaded mistakenly into encrypted flash.

Postby draval » Fri May 14, 2021 3:39 pm

Hi all,

I have enabled the secure boot and flash encryption both with two separate 256 bit externally generated keys. I have burn these keys first into efuse. Than i first download bootloader and than plain text firmware into my ESP32-WROOM-32D.

I have successfully checked that my code worked fine. But mistakenly I downloaded plain text firmware binary of my app along with flash partition table binary and ota init binary. Than my firmware was rebooting continuously.

Than i do erase_flash operation and downloaded bootloader encrypted binary to my ESP board. And after that i download encrypted app,partition and ota init binaries to my ESP board. Now i am getting below error continuously.

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57


See my configuration as below

[*] Enable hardware secure boot in bootloader (READ DOCS FIRST)
Secure bootloader mode (Reflashable) --->
[*] Sign binaries during build
(secure_boot_signing_key.pem) Secure boot private signing key
Hardware Key Encoding (No encoding (256 bit key)) --->
[ ] Allow potentially insecure options
[*] Enable flash encryption on boot (READ DOCS FIRST)
[ ] Allow potentially insecure options (NEW)
[*] Disable serial reflashing of plaintext firmware (NEW)


Please guide me. What can i do now to reuse my board.
Thanks in advance.
Darshak.

Who is online

Users browsing this forum: awegel, ESP_rrtandler, zelenecul and 126 guests