ESP32 hangs when running my application in the OTA partition.

JainamShah
Posts: 16
Joined: Thu Jul 29, 2021 6:52 am

ESP32 hangs when running my application in the OTA partition.

Postby JainamShah » Mon Sep 06, 2021 5:56 am

Hello,
I am working on the update using OTA. I have experienced a problem with my application. After downloading and restarting, my application hangs in the OTA partition. I have attached the console logs here.
  1. I (29) boot: ESP-IDF v4.3-dirty 2nd stage bootloader
  2. I (29) boot: compile time 10:16:50
  3. I (29) boot: chip revision: 1
  4. I (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0
  5. I (39) boot.esp32: SPI Speed      : 40MHz
  6. I (44) boot.esp32: SPI Mode       : DIO
  7. I (48) boot.esp32: SPI Flash Size : 4MB
  8. I (53) boot: Enabling RNG early entropy source...
  9. I (58) boot: Partition Table:
  10. I (62) boot: ## Label            Usage          Type ST Offset   Length
  11. I (69) boot:  0 nvs              WiFi data        01 02 00009000 00004000
  12. I (77) boot:  1 otadata          OTA data         01 00 0000d000 00002000
  13. I (84) boot:  2 phy_init         RF data          01 01 0000f000 00001000
  14. I (91) boot:  3 factory          factory app      00 00 00010000 00100000
  15. I (99) boot:  4 ota_0            OTA app          00 10 00110000 00100000
  16. I (106) boot:  5 ota_1            OTA app          00 11 00210000 00100000
  17. I (114) boot: End of partition table
  18. I (118) boot_comm: chip revision: 1, min. application chip revision: 0
  19. I (125) esp_image: segment 0: paddr=00110020 vaddr=3f400020 size=25da0h (155040) map
  20. I (193) esp_image: segment 1: paddr=00135dc8 vaddr=3ffb0000 size=04480h ( 17536) load
  21. I (200) esp_image: segment 2: paddr=0013a250 vaddr=40080000 size=05dc8h ( 24008) load
  22. I (210) esp_image: segment 3: paddr=00140020 vaddr=400d0020 size=a5178h (676216) map
  23. I (466) esp_image: segment 4: paddr=001e51a0 vaddr=40085dc8 size=11094h ( 69780) load
  24. I (496) esp_image: segment 5: paddr=001f623c vaddr=50000200 size=00010h (    16) load
  25. I (508) boot: Loaded app from partition at offset 0x110000
  26. I (509) boot: Disabling RNG early entropy source...
  27. I (520) cpu_start: Pro cpu up.
  28. I (520) cpu_start: Starting app cpu, entry
As you see the current partition is ota_0 and it hangs at the last line every time.

Also, I have manually flashed the same application binary file on this OTA partition, it still hangs. And same working on factory app partition.

Kindly help me with this.

Regards,
Jainam shah.

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 hangs when running my application in the OTA partition.

Postby ESP_Sprite » Tue Sep 07, 2021 1:04 am

Just to make sure: your ESP32 indeed has 4MiB of flash, right?

JainamShah
Posts: 16
Joined: Thu Jul 29, 2021 6:52 am

Re: ESP32 hangs when running my application in the OTA partition.

Postby JainamShah » Tue Sep 07, 2021 4:11 am

Yes

azeater
Posts: 1
Joined: Wed Feb 02, 2022 5:43 am

Re: ESP32 hangs when running my application in the OTA partition.

Postby azeater » Wed Feb 02, 2022 6:10 am

Sorry to bump an old topic but I have the exact same issue. I'm using ESP-IDF v. 4.3.0 on Platform IO.

My project involves having a small test application written to the factory partition and on successful completion sets the next boot partition to ota_0. Since this is done in the factory I don't wish to do an OTA update from factory - I'd rather flash the partition manually and just set it after the fact.

My partition map is the following:

Code: Select all

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,   0x4000,
otadata,  data, ota,     0xd000,   0x2000,
phy_init, data, phy,     0xf000,   0x1000,
factory,   app,  factory,  0x10000,  0x80000,
ota_0,    app,  ota_0,   0x90000,  0x140000,
ota_1,    app,  ota_1,   0x1D0000, 0x140000,
I use the following command to flash my images:

Code: Select all

esptool.py --chip esp32 --port "COM20" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader.bin 0x8000 partitions.bin 0xd000 ota_data_initial.bin 0x10000 test.bin 0x90000 app.bin
In my factory app, I set the OTA boot partition using

Code: Select all

esp_ota_set_boot_partition
but the application just hangs at

Code: Select all

(0) cpu_start: App cpu up.␛[0m
Has anyone had a similar issue and solved it? Or perhaps could share an example of a working project with a factory/test app in conjunction with 2 ota partitions.

Who is online

Users browsing this forum: No registered users and 243 guests