-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP.restart() or auto-reboot after firmware update causes boot loop #7306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Annoyingly, if I set -DDEBUG_ESP_CORE, the problem goes away.... I am currently building with the following:
Normally, I would build with:
|
I'm still seeing this on two other D1 Mini's that are installed in non-easy to reach places - I can see the onboard LED blinking as it does a reset loop - and I can only easily get to the power to turn it off and on again... After I do this, the normal code launches fine - until I reboot or send a firmware to it. At that point, we enter the reboot loop again... Any suggestions on this? |
What are the step to reproduce? |
I have reproduced this with and without debug enabled. It happens on both ESP.restart() or after you upload a firmware via http.
Or even if the reset happens after downloading firmware via https and the unit does a restart after the firmware had been flashed.
…On 16 May 2020 8:45:42 pm AEST, david gauchard ***@***.***> wrote:
What are the step to reproduce?
Is it simply doing an OTA then call `ESP.restart()` (with and without
`DEBUG_ESP_CORE`) ?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#7306 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
@CRCinAU you forgot an MCVE to reproduce. Please remember that it must not include 3rd party libs. |
Well, here's the annoying part - if I upload my 'basic web update' program that I use as a bootloader, I can flash that and reboot it as many times as I like... That code is at: https://git.crc.id.au/netwiz/ESP8266_Code/src/branch/master/BasicWebUpdate/src/BasicWebUpdate.ino If I flash the "OutdoorMonitor" code from the same git, then it fails every reboot - even if that's just to upload the new binary via the /update URL on the BasicWebUpdate flash. The "GarageDoor" code from here also fails to reboot: These were both working fine before a |
To try and rule out any issue, I wiped the entire flash by using esptool erase_flash, then wrote a 4Mb blank file, then sent the code to the device again. Connected properly to the HostAP for WifiManager, connected it to my wifi network fine, first reboot caused it to go into the boot loop again. Have attached the confirmed failing binary in case that helps. To confirm, the full source code for this binary is here: It seems that the call to ESP.restart() works, but after that point, the never ending boot loop until you powercycle the device or reflash it over USB... Edit: removed attachment. |
Please don't attach binary files. |
Correct. If I flashed the basic web updater, it can reboot via the /reboot web address, and via the /update web address after a firmware load happens. I couldn't make this go into the boot loop. As soon as I sent the other binary to the /update URL, it went into a boot loop. |
Then something in your code or in the 3rd party libs is causing the problem. |
Hmmm - at the moment, the only thing I can see is the upgrades done via
The use of the custom framework path to this git should cause the espressif8266 part to be ignored - leaving only the toolchain-xtensa as a possible problem? As I have a version number on this, I'll try to downgrade it somehow and see what happens... |
Ok - I've hit something that I can reproduce.... If I comment out the following lines in my
I note that I've been using these lines in my @devyte - Does this ring any bells as to why this would suddenly start causing issues? |
Not really. |
I don't have the Arduino IDE installed, so I'll have to look at doing that from scratch... On a similar topic, if I call Right now, I'm trying to either prove or disprove that compiling with the code set to switch to 160Mhz is the culprit in causing the boot loop... |
The cpu freq changes whether you build with 80 or 160. It depends on several things. I'm not sure, but I don't think that changing it should cause a crash. |
Here's my current data set: Build at 80 Mhz ( Build at 160Mhz ( |
very interesting as I have a similar issue and was not able to reproduce it reliably |
OTA wih 80 Mhz CPU and 40 Mhz flash is ok - however I cannot explain why |
Platform
Problem Description
When calling ESP.restart() or when rebooting after uploading firmware, the D1 Mini goes into a reboot loop. Output from the serial console below shows a successful boot on power on, then the first reboot after calling ESP.restart(), then the boot loop.
This continues until the reset button is hit on the device and a normal boot occurs.
EDIT: To add context, I did a
pio update
which pulled down the latest frameworks, then rebuilt all my existing projects and flashed them OTA. After this, all of the D1 Minis that were updated showed this problem.Current versions:
However I use this in
platformio.ini
to pull in the latest framwork from here:The text was updated successfully, but these errors were encountered: