Skip to content
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

[TW#24595] Bootloader locks up when OTA is set but no OTA partition is present. #2218

Closed
3 tasks
OtherCrashOverride opened this issue Jul 24, 2018 · 5 comments
Closed
3 tasks

Comments

@OtherCrashOverride
Copy link

Environment

  • Development Kit: [ODROID-GO]
  • Kit version (v1]
  • Core (if using chip or module): [ESP32-Wrover]
  • IDF version f198339
  • Development Env: [Make]
  • Operating System: [|Ubuntu]
  • Power Supply: [USB|Battery]

Problem Description

When a project is flashed that has an OTA partition and that OTA is set as active, flashing a new project that does not have an OTA partition causes the bootloader to hang.

Expected Behavior

If an OTA partition is expected, but not present, the factory partition should be used instead.

Actual Behavior

Bootloader hangs. The flash must be erased to restore operation.

Steps to repropduce

  1. Create a project with an OTA partition.
  2. Perform an OTA.
  3. Flash (make flash) a project that does not have an OTA partition.
  4. Observe inability to boot.

Code to reproduce this issue

Debug Logs

I (29) boot: ESP-IDF v3.1-beta1-42-gd5c0610 2nd stage bootloader
I (29) boot: compile time 20:29:57
I (31) boot: Enabling RNG early entropy source...
I (35) qio_mode: Enabling QIO for flash chip GD
I (40) boot: SPI Speed      : 80MHz
I (44) boot: SPI Mode       : QIO
I (48) boot: SPI Flash Size : 16MB
I (52) boot: Partition Table:
I (56) boot: ## Label            Usage          Type ST Offset   Length
I (63) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (70) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (78) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (85) boot:  3 firmware         factory app      00 00 00010000 000f0000
I (93) boot: End of partition table

Other items if possible

  • sdkconfig file (attach the sdkconfig file from your project folder)
  • elf file in the build folder (note this may contain all the code details and symbols of your project.)
  • coredump (This provides stacks of tasks.)
@OtherCrashOverride
Copy link
Author

Also note that "GPIO triggers factory reset" is not able to recover from this condition.

@negativekelvin
Copy link
Contributor

The new project has an otadata partition in its partition table?

@KonstantinKondrashov
Copy link
Collaborator

Hi @OtherCrashOverride !
I reproduced your issue. When you change partition table you need to do a command make erase_flash.

Regarding why booting not starting from the factory: here has an error of division on zero (https://github.com/espressif/esp-idf/blob/master/components/bootloader_support/src/bootloader_utility.c#L253) because you remove ota_x and remain an ota_data partition (bs->app_count = 0).

We will fix this.

@FayeY FayeY changed the title Bootloader locks up when OTA is set but no OTA partition is present. [TW#24595] Bootloader locks up when OTA is set but no OTA partition is present. Jul 26, 2018
@FayeY
Copy link
Collaborator

FayeY commented Jul 26, 2018

Hi @OtherCrashOverride , this issue should have been fixed, please have a try and feel free to reopen if your problem is still unsolved. Thanks.

@FayeY FayeY closed this as completed Jul 26, 2018
@igrr
Copy link
Member

igrr commented Jul 26, 2018

Keeping this open for now — the fix is not on Github yet. Issue will be closed automatically when the fix is deployed.

@igrr igrr reopened this Jul 26, 2018
@igrr igrr closed this as completed in 8c808c2 Jul 28, 2018
igrr pushed a commit that referenced this issue Jul 30, 2018
… entry

If we have the partition table without any ota_apps but in ota_data have
valide entry, in this case we get an error(hang). This commit fix this
case. If bs->app_count is zero when selecting the factory app.

Closes #2218
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
… entry

If we have the partition table without any ota_apps but in ota_data have
valide entry, in this case we get an error(hang). This commit fix this
case. If bs->app_count is zero when selecting the factory app.

Closes espressif/esp-idf#2218
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
… entry

If we have the partition table without any ota_apps but in ota_data have
valide entry, in this case we get an error(hang). This commit fix this
case. If bs->app_count is zero when selecting the factory app.

Closes espressif/esp-idf#2218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants