Device keeps rebooting

asadislam94
Posts: 2
Joined: Mon Feb 13, 2017 2:05 pm

Device keeps rebooting

Postby asadislam94 » Mon Feb 13, 2017 3:23 pm

Hi
I flashed the device with the blink example code. After flashing the device keeps rebooting with the error codes as shown in the picture. I think this is related to the fact that I enabled flash encryption before compiling. Now even when I reflash the device I get the same error.
Does anyone know how to solve this problem?
Attachments
Capture.PNG
Capture.PNG (16.59 KiB) Viewed 10282 times

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Device keeps rebooting

Postby ESP_Angus » Mon Feb 13, 2017 11:20 pm

Hi,

Yes, if you enable flash encryption then the first boot will generate a device specific key and encrypt the flash using this key. So a subsequent update where you flash an unencrypted binary means that the device no longer boots, as it expects to see encrypted flash.

The good news is, you can remove flash encryption. You can do this (enable then disable encryption) 4 times total, after that you cannot enable flash encryption again.

First, run "make menuconfig" and disable flash encryption in Security Options. This is very important, or the device will just re-encrypt itself again as soon as you disable encryption. Save the configuration then run "make menuconfig" one more time to be sure flash encryption is disabled correctly! Then run "make flash" to build and flash this new bootloader and app to the ESP32. At this point the ESP32 still won't boot.

Second, run the following command. The espefuse.py command is in the components/esptool_py/esptool directory:

Code: Select all

espefuse.py --port PORT burn_efuse FLASH_CRYPT_CNT
Once you reset the ESP32, it should boot unencrypted.

If you want to update the device while keeping flash encryption on, the steps are in the documentation:
http://esp-idf.readthedocs.io/en/latest ... -procedure
(Bear in mind you can only reflash with encryption on 3 times, before other updates are no longer possible.)

Please read the flash encryption documentation thoroughly before enabling this feature again:
http://esp-idf.readthedocs.io/en/latest ... ption.html

We'll also add a warning to the configuration menu, so it's clear this is a potentially device-bricking feature.

Angus

Who is online

Users browsing this forum: Bing [Bot] and 77 guests