-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TW#23395] ota update fail #2068
Comments
We are experiencing the same issue, reported directly to management team on May 24: We are having an issue with latest SDK - images are being declared corrupt:
We are seeing this: E (918793) esp_image: Image hash failed - image is corrupt E (918794) upgrade: IMAGE VERIFY: 0 0, 0 0, 0 0 0, 0, 0 (0 0 0) 0 E (918945) esp_image: Image hash failed - image is corrupt E (918945) upgrade: IMAGE VERIFY: 0 0, 0 0, 0 0 0, 0, 0 (0 0 0) 0 E (919098) esp_image: Image hash failed - image is corrupt E (919099) upgrade: Failed to activate boot partition ota_1, error 5379 I used this version when I discovered the issue, and rolling back solved it: |
By the way, it works if I roll back to 595ddfd: E (132298) upgrade: IMAGE VERIFY: 65536 938432, 233 7, 2 0 1, 1074270224, 238 (0 0 0) 1 E (132841) upgrade: IMAGE VERIFY: 1048576 938432, 233 7, 2 0 1, 1074270224, 238 (0 0 0) 1 E (132841) upgrade: OTA END: 261 E (133452) upgrade: Boot partition activated: ota_1 |
Ok, so it looks like the many recent changes to the SHA256 code have caused this problem. Here is a log of OTAing the same image and then a slightly different image. I made a code change to ignore the SHA256 error, as well. The bootloader is calculating the SHA256 correctly, but not the runtime code: E (272944) esp_image: Calculated hash: 00000000 E (272945) esp_image: Image hash failed - image is corrupt E (272946) esp_image: Expected hash: cd818cf9 E (272946) upgrade: IMAGE VERIFY: 65536 949600, 233 9, 2 0 1, 1074270372, 238 (0 0 0) 1 E (273135) esp_image: Calculated hash: 00000000 E (273136) esp_image: Image hash failed - image is corrupt E (273137) esp_image: Expected hash: cd818cf9 E (273137) upgrade: IMAGE VERIFY: 1048576 949600, 233 9, 2 0 1, 1074270372, 238 (0 0 0) 1 E (273137) upgrade: OTA END: 261 E (273326) esp_image: Calculated hash: 00000000 E (273327) esp_image: Image hash failed - image is corrupt E (273328) esp_image: Expected hash: cd818cf9 E (273398) upgrade: Boot partition activated: ota_1 E (273591) esp_image: Calculated hash: 00000000 E (273592) esp_image: Image hash failed - image is corrupt E (273593) esp_image: Expected hash: cd818cf9 E (273658) upgrade: Boot partition activated: ota_1 Flash success and closing socket RESETTING E (342) esp_image: Calculated hash: cd818cf9 E (360005) esp_image: Calculated hash: 00000000 E (360006) esp_image: Image hash failed - image is corrupt E (360007) esp_image: Expected hash: 2bc866c1 E (360007) upgrade: IMAGE VERIFY: 65536 949600, 233 9, 2 0 1, 1074270372, 238 (0 0 0) 1 E (360196) esp_image: Calculated hash: 00000000 E (360197) esp_image: Image hash failed - image is corrupt E (360198) esp_image: Expected hash: cd818cf9 E (360198) upgrade: IMAGE VERIFY: 1048576 949600, 233 9, 2 0 1, 1074270372, 238 (0 0 0) 1 E (360198) upgrade: OTA END: 261 E (360385) esp_image: Calculated hash: 00000000 E (360386) esp_image: Image hash failed - image is corrupt E (360387) esp_image: Expected hash: 2bc866c1 E (360454) upgrade: Boot partition activated: ota_0 Flash success and closing socket RESETTING E (342) esp_image: Calculated hash: 2bc866c1 |
This is my version of the end of esp_image_format.c in components/bootloader_support/src/:
|
Hi, @infotrino, @iosix. Could you send your |
Hi, My sdkconfig.h is .. /*
*/ |
|
Hi, @infotrino, @iosix. I tried to reproduce your error but I can't. We have an example Could you confirm flash chip size by doing? |
@infotrino. I note one moment in your code. Why do you have constant |
It’s very clear that the changes to the SHA256 function between the two commit versions I mentioned have resulted in SHA256 returning 0 when running live. This is why it isn’t working. Please investigate the code changes for correctness. Many of them have to do with timing and synchronization.
Robert Vogt IV
CEO
IOSiX, LLC
389 Airport Industrial Drive
Ypsilanti, MI 48198
P: +1-855-OBD-1939
C: +1-734-730-9690
robert@iosix.com
… On Jun 21, 2018, at 8:42 AM, Konstantin Kondrashov ***@***.***> wrote:
Hi, @infotrino, @iosix. I tried to reproduce your error but I can't. We have an example ~/esp/esp-idf/examples/system/ota, it works without error. I think this simple example, on your side, works also good, as well. Is it true? I think error depends on other tasks in FreeRTOS. Could you give a code which reproduces this error?
Could you confirm flash chip size by doing?
1 esptool.py --port COM4 flash_id
2. partition table make partition_table
3. size your image firmware.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi KonstantinKondrshov, |
Hi @infotrino, @iosix. I reproduced your error. It depends on the option |
Hi KonstantinKondrshov, |
Moved useful functions from wrapped assert functions, because option `CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y` will remove this functions. Closes #2068
Moved useful functions from wrapped assert functions, because option `CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y` will remove this functions. Closes espressif/esp-idf#2068
Moved useful functions from wrapped assert functions, because option `CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y` will remove this functions. Closes espressif/esp-idf#2068
…ng main header. Removed the asio headers which require Boost libraries. Moved http_parser into the expected location. (espressif#2068)
Environment
git rev-parse --short HEAD
to get the commit id.): ff9a250Problem Description
When execute ota update, esp_ota_end(...) gives Error ( esp_image: Image hash failed - image is corrupt)
This error is solved by roll back to previous ESP-IDF. (that is 20180612 version --> 20180505 version)
Actual Behavior
I (58933) esp_image: segment 0: paddr=0x000c0020 vaddr=0x3f400020 size=0x06850 ( 26704) map
I (58953) esp_image: segment 1: paddr=0x000c6878 vaddr=0x3ffb0000 size=0x022d4 ( 8916)
I (58963) esp_image: segment 2: paddr=0x000c8b54 vaddr=0x3ffb22d4 size=0x00000 ( 0)
I (58973) esp_image: segment 3: paddr=0x000c8b5c vaddr=0x40080000 size=0x00400 ( 1024)
0x40080000: _iram_start at D:/ghlee/18.esp32/esp-idf/components/freertos/xtensa_vectors.S:1685
I (58983) esp_image: segment 4: paddr=0x000c8f64 vaddr=0x40080400 size=0x070ac ( 28844)
I (59003) esp_image: segment 5: paddr=0x000d0018 vaddr=0x400d0018 size=0x135d4 ( 79316) map
0x400d0018: _stext at ??:?
I (59023) esp_image: segment 6: paddr=0x000e35f4 vaddr=0x400874ac size=0x02400 ( 9216)
0x400874ac: ppSearchTxframe at ??:?
I (59033) esp_image: segment 7: paddr=0x000e59fc vaddr=0x400c0000 size=0x00064 ( 100)
I (59033) esp_image: segment 8: paddr=0x000e5a68 vaddr=0x50000200 size=0x00008 ( 8)
I (59033) esp_image: segment 9: paddr=0x000e5a78 vaddr=0x50000208 size=0x00000 ( 0)
E (59033) esp_image: Image hash failed - image is corrupt
E (59033) avs_auth: esp_ota_end failed! (5379)
Steps to repropduce
Code to reproduce this issue
int write_ota(esp_ota_handle_t update_handle, char* p, int len)
{
esp_err_t err = esp_ota_write( update_handle, (const void *)p, len);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Error: esp_ota_write failed! err=0x%x", err);
}
return len;
}
void ota_example_task(int socket_id)
{
esp_err_t err;
esp_ota_handle_t update_handle = 0 ;
const esp_partition_t *update_partition = NULL;
}
The text was updated successfully, but these errors were encountered: