Image is corrupted error during OTA - what could be the reason?

Hi team,

I’m getting following error during OTA over Golioth.

What could be the reason and how to solve? TNX

I (31653) fw_block_processor: Downloading block index 4 (5/1087)
I (31663) golioth_fw_update: Download took 20290 ms
I (31663) fw_block_processor: Block Latency Stats:
I (31683) fw_block_processor: Min: 3420 ms
I (31683) fw_block_processor: Ave: 153.729 ms
I (31683) fw_block_processor: Max: 4710 ms
I (31693) fw_block_processor: Total bytes written: 4096
I (31693) esp_image: segment 0: paddr=001a0020 vaddr=3c0d0020 size=2c39ch (181148) map
E (31733) esp_image: invalid segment length 0xffffffff
E (31733) fw_update_esp_idf: Image validation failed, image is corrupted
E (31733) golioth_fw_update: Firmware validate failed
I (31743) golioth_fw_update: State = Idle

Hi @Leg

Could you tell us a bit more about your setup? Looks like ESP-IDF, are you seeing any errors during download? What part is this on? Anything else you think that might be relevant?

Hi Chris,
thank you for your respond. Yes, it’s ESP-IDF and ESP32S3

We’ve solved the issue.

There were not enough available heap memory to process an update.

Debugged with
esp_get_free_heap_size()
esp_get_minimum_free_heap_size()

After heap optimization updates work properly.

Thank you!

1 Like