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.

Code: Untitled.txt Select all


I (29) boot: ESP-IDF v4.3-dirty 2nd stage bootloader
I (29) boot: compile time 10:16:50
I (29) boot: chip revision: 1
I (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed : 40MHz
I (44) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 4MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (77) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (84) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (91) boot: 3 factory factory app 00 00 00010000 00100000
I (99) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (106) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (114) boot: End of partition table
I (118) boot_comm: chip revision: 1, min. application chip revision: 0
I (125) esp_image: segment 0: paddr=00110020 vaddr=3f400020 size=25da0h (155040) map
I (193) esp_image: segment 1: paddr=00135dc8 vaddr=3ffb0000 size=04480h ( 17536) load
I (200) esp_image: segment 2: paddr=0013a250 vaddr=40080000 size=05dc8h ( 24008) load
I (210) esp_image: segment 3: paddr=00140020 vaddr=400d0020 size=a5178h (676216) map
I (466) esp_image: segment 4: paddr=001e51a0 vaddr=40085dc8 size=11094h ( 69780) load
I (496) esp_image: segment 5: paddr=001f623c vaddr=50000200 size=00010h ( 16) load
I (508) boot: Loaded app from partition at offset 0x110000
I (509) boot: Disabling RNG early entropy source...
I (520) cpu_start: Pro cpu up.
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.

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

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

Postby 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: ChatGPT-User, dmaxben, PetalBot, Semrush [Bot] and 9 guests