ESP32S3 failure in esp_ota_end()
Posted: Sat Dec 30, 2023 12:03 pm
I am implementing update over USB HID for my application, following the native OTA example. I can write the complete binary image using esp_ota_write, and when I call esp_ota_end, the application hangs with message:
I found a topic dealing with similar issue here, and the solution the author proposed was modifying access to global variables. How would that help? If this is the case, how to find the offending variable? My project is quite large and I need some direction about what to look for.
Relevant log:
EDIT: I get the same error using latest espidf master branch, with a watchdog reset right after the following message:
and after a while a WDT reset is issued.I (184599) esp_image: segment 0: paddr=00210020 vaddr=3c060020 size=1f13ch (127292) map
I found a topic dealing with similar issue here, and the solution the author proposed was modifying access to global variables. How would that help? If this is the case, how to find the offending variable? My project is quite large and I need some direction about what to look for.
Relevant log:
Code: Select all
�x������ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0xb (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x164c
load:0x403c9700,len:0xbe0
load:0x403cc700,len:0x2ef8
SHA-256 comparison failed:
Calculated: 3b1e244f79920e4deddd0d0122e19def7def0fbdf3709306078086a1c8bd59b0
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c9900
I (43) boot: ESP-IDF v5.0.1-dirty 2nd stage bootloader
I (43) boot: compile time 11:23:05
I (43) boot: chip revision: v0.2
I (45) boot.esp32s3: Boot SPI Speed : 80MHz
I (50) boot.esp32s3: SPI Mode : DIO
I (55) boot.esp32s3: SPI Flash Size : 8MB
I (60) boot: Enabling RNG early entropy source...
I (65) boot: Partition Table:
I (69) boot: ## Label Usage Type ST Offset Length
I (76) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (83) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (91) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (98) boot: 3 factory factory app 00 00 00010000 00100000
I (106) boot: 4 ota_0 OTA app 00 10 00210000 00100000
I (113) boot: 5 ota_1 OTA app 00 11 00410000 00100000
I (121) boot: 6 ffat Unknown data 01 81 00510000 00020000
I (129) boot: End of partition table
I (133) boot: Defaulting to factory image
I (138) esp_image: segment 0: paddr=00010020 vaddr=3c060020 size=1f13ch (127292) map
I (160) esp_image: segment 1: paddr=0002f164 vaddr=3fc97000 size=00eb4h ( 3764) load
I (161) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=54cbch (347324) map
I (205) esp_image: segment 3: paddr=00084ce4 vaddr=3fc97eb4 size=020d8h ( 8408) load
I (206) esp_image: segment 4: paddr=00086dc4 vaddr=40374000 size=12f34h ( 77620) load
I (223) esp_image: segment 5: paddr=00099d00 vaddr=600fe000 size=0003ch ( 60) load
I (230) boot: Loaded app from partition at offset 0x10000
I (231) boot: Disabling RNG early entropy source...
I (243) cpu_start: Pro cpu up.
I (243) cpu_start: Starting app cpu, entry point is 0x40375804
0x40375804: call_start_cpu1 at /home/null/esp/esp-idf/components/esp_system/port/cpu_start.c:142
I (0) cpu_start: App cpu up.
I (257) cpu_start: Pro cpu start user code
I (257) cpu_start: cpu freq: 160000000 Hz
I (257) cpu_start: Application information:
I (260) cpu_start: Project name: myapp
I (266) cpu_start: App version: 1
I (271) cpu_start: Compile time: Dec 30 2023 11:23:03
I (277) cpu_start: ELF file SHA256: 4aa97be7cff9ed89...
I (283) cpu_start: ESP-IDF: v5.0.1-dirty
I (288) cpu_start: Min chip rev: v0.0
I (293) cpu_start: Max chip rev: v0.99
I (298) cpu_start: Chip rev: v0.2
I (302) heap_init: Initializing. RAM available for dynamic allocation:
I (310) heap_init: At 3FC9CF90 len 0004C780 (305 KiB): D/IRAM
I (316) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (323) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (329) heap_init: At 600FE03C len 00001FC4 (7 KiB): RTCRAM
I (336) spi_flash: detected chip: issi
I (340) spi_flash: flash io: dio
I (345) sleep: Configure to isolate all GPIO pins in sleep state
I (350) sleep: Enable automatic switching of GPIO sleep configuration
I (358) cpu_start: Starting scheduler on PRO CPU.
***********************************
I (709) ao_firmware_updater: Running partition type 0 subtype 0 (offset 0x00010000)
I (4809) ao_firmware_updater: Expected image size in bytes: 564544
I (6179) ao_firmware_updater: FW Update data, 1024 bytes:
I (6179) ao_firmware_updater: New firmware version: 1
I (6179) ao_firmware_updater: Running firmware version: 1
I (6189) ao_firmware_updater: Writing to partition subtype 16 at offset 0x210000
I (6189) ao_firmware_updater: esp_ota_begin succeeded, handle: 1
I (6269) ao_firmware_updater: Writting first 1024 bytes of 564544 bytes
I (6549) ao_firmware_updater: Progress: 0.36%
I (6829) ao_firmware_updater: Progress: 0.54%
***********************************
I (184389) ao_firmware_updater: Progress: 99.94%
I (184589) ao_firmware_updater: Progress: 100.00%
I (184589) ao_firmware_updater: Finished binary image write, validating...
I (184599) esp_image: segment 0: paddr=00210020 vaddr=3c060020 size=1f13ch (127292) map
/* REBOOTS... */
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0xb (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037e1ab
0x4037e1ab: panic_handler at /home/null/esp/esp-idf/components/esp_system/port/panic_handler.c:147 (discriminator 3)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x164c
load:0x403c9700,len:0xbe0
load:0x403cc700,len:0x2ef8
SHA-256 comparison failed:
Calculated: 3b1e244f79920e4deddd0d0122e19def7def0fbdf3709306078086a1c8bd59b0
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c9900
I (47) boot: ESP-IDF v5.0.1-dirty 2nd stage bootloader
I (48) boot: compile time 11:23:05
I (48) boot: chip revision: v0.2
I (50) boot.esp32s3: Boot SPI Speed : 80MHz
I (55) boot.esp32s3: SPI Mode : DIO
I (59) boot.esp32s3: SPI Flash Size : 8MB
W (64) boot.esp32s3: PRO CPU has been reset by WDT.
W (70) boot.esp32s3: APP CPU has been reset by WDT.
I (75) boot: Enabling RNG early entropy source...
I (81) boot: Partition Table:
I (84) boot: ## Label Usage Type ST Offset Length
I (92) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (99) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (106) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (114) boot: 3 factory factory app 00 00 00010000 00100000
I (122) boot: 4 ota_0 OTA app 00 10 00210000 00100000
I (129) boot: 5 ota_1 OTA app 00 11 00410000 00100000
I (137) boot: 6 ffat Unknown data 01 81 00510000 00020000
I (144) boot: End of partition table
I (149) boot: Defaulting to factory image
I (153) esp_image: segment 0: paddr=00010020 vaddr=3c060020 size=1f13ch (127292) map
I (176) esp_image: segment 1: paddr=0002f164 vaddr=3fc97000 size=00eb4h ( 3764) load
I (177) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=54cbch (347324) map
I (221) esp_image: segment 3: paddr=00084ce4 vaddr=3fc97eb4 size=020d8h ( 8408) load
I (222) esp_image: segment 4: paddr=00086dc4 vaddr=40374000 size=12f34h ( 77620) load
I (238) esp_image: segment 5: paddr=00099d00 vaddr=600fe000 size=0003ch ( 60) load
I (246) boot: Loaded app from partition at offset 0x10000
I (246) boot: Disabling RNG early entropy source...
I (258) cpu_start: Pro cpu up.
I (258) cpu_start: Starting app cpu, entry point is 0x40375804
0x40375804: call_start_cpu1 at /home/null/esp/esp-idf/components/esp_system/port/cpu_start.c:142
I (0) cpu_start: App cpu up.
I (273) cpu_start: Pro cpu start user code
I (273) cpu_start: cpu freq: 160000000 Hz
I (273) cpu_start: Application information:
I (276) cpu_start: Project name: myapp
I (282) cpu_start: App version: 1
I (286) cpu_start: Compile time: Dec 30 2023 11:23:03
I (292) cpu_start: ELF file SHA256: 4aa97be7cff9ed89...
I (298) cpu_start: ESP-IDF: v5.0.1-dirty
I (304) cpu_start: Min chip rev: v0.0
I (308) cpu_start: Max chip rev: v0.99
I (313) cpu_start: Chip rev: v0.2
I (318) heap_init: Initializing. RAM available for dynamic allocation:
I (326) heap_init: At 3FC9CF90 len 0004C780 (305 KiB): D/IRAM
I (332) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (338) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (344) heap_init: At 600FE03C len 00001FC4 (7 KiB): RTCRAM
I (352) spi_flash: detected chip: issi
I (355) spi_flash: flash io: dio
***********************************************************
esp_image: segment 0: paddr=00210020 vaddr=3c060020 size=22eb8h (143032) map