ota checksum failed

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

ota checksum failed

Postby imtiaz » Thu Jul 13, 2017 12:27 am

Hi Espressif ,

This looks like a hardware problem on our module - can someone help me as to the reason why this may happen. After doing an OTA update of the esp32 I get :

E (148645) esp_image: checksum failed. Calculated 0x8d read 0xff

The bootloader is updating through serial fine - so Im not sure what the issue could be in hardware. The same software works fine on off the shelf modules.

I've reduced my SPI speed to 20MHZ , DIO mode - the chip is a standard supported chip.

Regards
Imtiaz

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

Re: ota checksum failed

Postby ESP_Sprite » Thu Jul 13, 2017 1:31 am

What OTA process do you use? Can you use the bootloader and esptool.py to read the OTA partition back over serial and compare that with what it should be? It sounds like your OTA image gets corrupted somewhere in the process...

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: ota checksum failed

Postby imtiaz » Thu Jul 13, 2017 3:23 am

Hi @ESP_Sprite,

The OTA process - download file over a tcp connection and write to OTA partition with the esp idf OTA API.

I am assuming that the TCP connection guarantees data integrity and order etc.

I have just tried storing the file in a another partition and calculating the MD5 hash of the received file - which is failing.

It seems that even though the file is sent successfully and received over tcp , the MD5 hash is failing - which I didn't think would be possible.

Any ideas - and this is only happens on our module which is quite badly tuned - RF wise ?

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

Re: ota checksum failed

Postby ESP_Sprite » Thu Jul 13, 2017 3:39 am

TCP should indeed mostly guarantee integrity - in theory, there's about a 0.01% chance that a packet that gets corrupted will go through the checks in the TCP proto alone, and even less when you keep the entire IP/WiFi stack in mind.

Maybe there's something in the flash that throws off the OTA process? Can you see what happens if you do a 'make erase_flash' on the module, reflash and re-try?

ESP_Angus
Posts: 2179
Joined: Sun May 08, 2016 4:11 am

Re: ota checksum failed

Postby ESP_Angus » Thu Jul 13, 2017 3:43 am

I've seen this kind of problem with faulty or browning out flash. Can you please share some details about the exact hardware configuration you have? (ie Espressif or other branded module, or bare chip on a custom board, what flash voltage, etc.)

If you still have physical access, one thing you can do is read back the OTA partition contents with "esptool.py read_flash addr filename", convert the original .bin and the readback .bin to HEX files, and diff the contents.

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: ota checksum failed

Postby imtiaz » Thu Jul 13, 2017 4:31 am

So it looks like if the tcp data is correct because I did an on the fly md5 hash (as I receive the packets) and it passes - but fails the hash on the flash partition.

Hardware configuration attached - its our own module.
Capture.PNG
schematic
Capture.PNG (67.26 KiB) Viewed 4055 times

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: ota checksum failed

Postby imtiaz » Thu Jul 13, 2017 5:06 am

Problem found - it was our power supply - not handling the peak currents - thanks for your help

Who is online

Users browsing this forum: No registered users and 13 guests