Page 1 of 1

ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Thu May 25, 2017 11:35 am
by miles
i use boot1.2 and use1.bin, and i am sure that i didn't do any upgrade operation, my esp8266 suddenly boot fail, it prints:

ets Jan 8 2013,rst cause:2, boot mode:(3,7)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
...

does my 2nd boot and user code in flash have been erased? or what's wrong with boot?
how can i read out my code in flash?

thanks.

my esp8266 normal print should be:
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 816, room 16
tail 0
chksum 0x8d
load 0x3ffe8000, len 788, room 8
tail 12
chksum 0xcf
ho 0 tail 12 room 4
load 0x3ffe8314, len 288, room 12
tail 4
chksum 0xcf
csum 0xcf

2nd boot version : 1.2
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size : 16Mbit
jump to run user1


compile time: May 10 2017 11:31:35
SDK version:1.5.0
...

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Sun May 28, 2017 10:42 pm
by pratik
Not sure why this is happening, how did this start happening?
Maybe you should re-flash the firmware.

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Wed May 31, 2017 3:56 pm
by miles
i am not sure how this start happening. i remembered that i successfully communicated with it when it powered on, that is i sent some request msg and got response msg. But a few minutes later, i found it had been dead, i can't receive any response msg again, and i power off this device, and know it boot fail.

1. can i read my code out before re-flash it?
2. as i use my own http download code, can i turn off the built-in http download or upgrade function?

thanks!

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Thu Jun 01, 2017 4:47 pm
by pratik
You can simply flash all BIN files again from the latest AT firmware.
You cannot directly read the flash and save its contents, but it probably will not be useful data anyway, because the newest firmware will work fine if your module is okay.

I hope you did not put 5V on some module pin? The module runs off 3.6V max. Over that can damage the module.

2. as i use my own http download code, can i turn off the built-in http download or upgrade function?

I did not clearly understand this. Are you talking about downloading and uploading data or are you talking about FOTA firmware update?

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Sat Jun 03, 2017 3:09 pm
by miles
I never put 5V on any module pin. The max voltage is 3.3V.

I means the OTA firmware upgrade. I used my own http download code to download firmware, and call spi_flash_write() to upgrade user1.bin to user2.bin or versa.

Since i didn't call built-in upgrade function, like system_upgrade_start(), can i disable it? I am afraid if built-in function has some relation with this problem.

thanks.

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Sun Jun 04, 2017 11:15 pm
by pratik
You just corrupted the flash somehow. It should be okay when you reflash all the BIN files again. :)
You do not need to disable the SDK FOTA functions, just don't ever call them in your application and it will be fine.

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Mon Jun 05, 2017 9:59 am
by miles
I know it will be ok if reflash all. I am afraid this bug will recur in somehow condition.

I want to analyze the flash to find the cause, and finally resovle this bug or avoid it.

Anyway, thanks a lot!

Re: ESP8266 suddenly boot fail, and never jump to 2nd boot or user code, help!

Posted: Wed Jun 07, 2017 3:26 pm
by pratik
When you use your own OTA functions, make sure you checksum the flash.
Also, do not try to upgrade boot.bin or touch system parameters area when you upgrade firmware. ONLY write to user1 or user2 area strictly.

The latest boot BIN will first try user1.bin... is checksum is invalid, it will jump to user2.bin. If both are invalid it will just print out an error and hang up the system.