Hi,
there are various boot modes which can be chosen by different GPIO voltage levels. Is there also a way to change the currently running user binary?
Let's assume I use OTA firmware updates. One day I accidentally upload a new version which has broken OTA support. Ooops. Now I cannot correct my mistake: The firmware has a correct checksum and it starts fine. So the bootloader will run it on every power on. What options do I have besides re-flashing the module?
It would be cool if there was a special GPIO setting to force either user1 or user2...
Changing the currently running user binary
Re: Changing the currently running user binary
Postby Her Mary » Fri Oct 13, 2017 10:06 am
AFAIK, the latest boot.bin v1.7 can boot to another user.bin if the current one broke. For example, the system should run the user2.bin after OTA, but there is something wrong in the user2.bin. So when the system power on, the boot.bin will try to startup user2.bin at first, but it fails, and then the boot.bin will try to startup the original user1.bin instead.
Re: Changing the currently running user binary
Postby blubb » Tue Oct 24, 2017 9:55 pm
After writing the flash using the spi_flash_erase_sector and spi_flash_write APIs, I do
system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();
to finalize the OTA upgrade.
Question: Is there a way to boot the new image ONLY ONCE? So that its functionality can be verified BEFORE the change becomes permanent?
Edit:
Question 2: How does the bootloader (1.7) determine the current image is "broken"? I understand it reverts the change and goes back to the other image if something is wrong. But what must be wrong? I've seen it boot one image that caused an exception over and over and over again with no attempt to go to the other image. I had to reflash manually via UART.
system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();
to finalize the OTA upgrade.
Question: Is there a way to boot the new image ONLY ONCE? So that its functionality can be verified BEFORE the change becomes permanent?
Edit:
Question 2: How does the bootloader (1.7) determine the current image is "broken"? I understand it reverts the change and goes back to the other image if something is wrong. But what must be wrong? I've seen it boot one image that caused an exception over and over and over again with no attempt to go to the other image. I had to reflash manually via UART.
Who is online
Users browsing this forum: No registered users and 120 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.