ESP32S3 FOTA using GSM Module
Posted: Mon Feb 06, 2023 8:08 am
Hello All,
I am using esp32s-esp-idf for my project, and in our application, have successfully implemented wifi-OTA.
Now, as a feature, am trying to do fota using questel's gsm module.
-ESP32S
-ESP-IDF v1.5.1
-Quectel's BG95
-partition table
nvs, 0x01, nvs, 0x11000, 0x8000,
otadata, 0x01, ota, 0x19000, 0x2000,
phy_init, 0x01, phy, 0x21000, 0x3000,
ota_0, 0x00, ota_0, 0x110000, 0x140000,
ota_1, 0x00, ota_1, 0x250000, 0x140000,
fatfs_storage, 0x01, fat, , 4M,
Please find my flow of code.
-http get request using gsm modem
-download .bin file from aws s3 server(successfully)
-this file is saved in Quectel's file system
-read file data of 1kb at a time and flash into esp(got no error while writing to flash)
-when esp_ota_end(update_handle) is been called, got error as 'ESP_ERR_OTA_VALIDATE_FAILED' i.e. 'Image validation failed, image is corrupted'
fota failure reply for BIN FILE(1)
I (424428) esp_image: segment 0: paddr=00250020 vaddr=3c0e0020 size=31960h (203104) map
I (424508) esp_image: segment 1: paddr=00281988 vaddr=3fc988f0 size=03d2ch ( 15660)
I (424518) esp_image: segment 2: paddr=002856bc vaddr=40374000 size=0a95ch ( 43356)
I (424538) esp_image: segment 3: paddr=00290020 vaddr=42000020 size=da4c0h (894144) map
I (424868) esp_image: segment 4: paddr=0036a4e8 vaddr=4037e95c size=09f88h ( 40840)
I (424888) esp_image: segment 5: paddr=00374478 vaddr=50000000 size=011fch ( 4604)
I (424888) esp_image: segment 6: paddr=0037567c vaddr=50001200 size=007c8h ( 1992)
I (424888) esp_image: segment 7: paddr=00375e4c vaddr=600fe000 size=00150h ( 336)
E (424898) esp_image: Checksum failed. Calculated 0xc7 read 0x61
Image validation failed, image is corrupted
Exiting task due to fatal error...
ERROR - FOTA ... failed!
fota failure reply for BIN FILE(2)
I (2262510) esp_image: segment 0: paddr=00250020 vaddr=3c0e0020 size=317f8h (202744) map
I (2262590) esp_image: segment 1: paddr=00281820 vaddr=3fc988d0 size=03d2ch ( 15660)
I (2262600) esp_image: segment 2: paddr=00285554 vaddr=40374000 size=0aac4h ( 43716)
I (2262620) esp_image: segment 3: paddr=00290020 vaddr=42000020 size=d9b50h (891728) map
I (2262950) esp_image: segment 4: paddr=00369b78 vaddr=4037eac4 size=09e08h ( 40456)
I (2262970) esp_image: segment 5: paddr=00373988 vaddr=50000000 size=011fch ( 4604)
I (2262970) esp_image: segment 6: paddr=00374b8c vaddr=50001200 size=00788h ( 1928)
I (2262970) esp_image: segment 7: paddr=0037531c vaddr=600fe000 size=00150h ( 336)
E (2262980) esp_image: Checksum failed. Calculated 0x39 read 0x1c
Image validation failed, image is corrupted
Exiting task due to fatal error...
ERROR - FOTA ... failed!
does anyone has got such type of issue while doing fota???
Can anyone help me to resolve this issue??
-Sneha
I am using esp32s-esp-idf for my project, and in our application, have successfully implemented wifi-OTA.
Now, as a feature, am trying to do fota using questel's gsm module.
-ESP32S
-ESP-IDF v1.5.1
-Quectel's BG95
-partition table
nvs, 0x01, nvs, 0x11000, 0x8000,
otadata, 0x01, ota, 0x19000, 0x2000,
phy_init, 0x01, phy, 0x21000, 0x3000,
ota_0, 0x00, ota_0, 0x110000, 0x140000,
ota_1, 0x00, ota_1, 0x250000, 0x140000,
fatfs_storage, 0x01, fat, , 4M,
Please find my flow of code.
-http get request using gsm modem
-download .bin file from aws s3 server(successfully)
-this file is saved in Quectel's file system
-read file data of 1kb at a time and flash into esp(got no error while writing to flash)
-when esp_ota_end(update_handle) is been called, got error as 'ESP_ERR_OTA_VALIDATE_FAILED' i.e. 'Image validation failed, image is corrupted'
fota failure reply for BIN FILE(1)
I (424428) esp_image: segment 0: paddr=00250020 vaddr=3c0e0020 size=31960h (203104) map
I (424508) esp_image: segment 1: paddr=00281988 vaddr=3fc988f0 size=03d2ch ( 15660)
I (424518) esp_image: segment 2: paddr=002856bc vaddr=40374000 size=0a95ch ( 43356)
I (424538) esp_image: segment 3: paddr=00290020 vaddr=42000020 size=da4c0h (894144) map
I (424868) esp_image: segment 4: paddr=0036a4e8 vaddr=4037e95c size=09f88h ( 40840)
I (424888) esp_image: segment 5: paddr=00374478 vaddr=50000000 size=011fch ( 4604)
I (424888) esp_image: segment 6: paddr=0037567c vaddr=50001200 size=007c8h ( 1992)
I (424888) esp_image: segment 7: paddr=00375e4c vaddr=600fe000 size=00150h ( 336)
E (424898) esp_image: Checksum failed. Calculated 0xc7 read 0x61
Image validation failed, image is corrupted
Exiting task due to fatal error...
ERROR - FOTA ... failed!
fota failure reply for BIN FILE(2)
I (2262510) esp_image: segment 0: paddr=00250020 vaddr=3c0e0020 size=317f8h (202744) map
I (2262590) esp_image: segment 1: paddr=00281820 vaddr=3fc988d0 size=03d2ch ( 15660)
I (2262600) esp_image: segment 2: paddr=00285554 vaddr=40374000 size=0aac4h ( 43716)
I (2262620) esp_image: segment 3: paddr=00290020 vaddr=42000020 size=d9b50h (891728) map
I (2262950) esp_image: segment 4: paddr=00369b78 vaddr=4037eac4 size=09e08h ( 40456)
I (2262970) esp_image: segment 5: paddr=00373988 vaddr=50000000 size=011fch ( 4604)
I (2262970) esp_image: segment 6: paddr=00374b8c vaddr=50001200 size=00788h ( 1928)
I (2262970) esp_image: segment 7: paddr=0037531c vaddr=600fe000 size=00150h ( 336)
E (2262980) esp_image: Checksum failed. Calculated 0x39 read 0x1c
Image validation failed, image is corrupted
Exiting task due to fatal error...
ERROR - FOTA ... failed!
does anyone has got such type of issue while doing fota???
Can anyone help me to resolve this issue??
-Sneha