Page 1 of 1

can't OTA .bin file from SD card

Posted: Fri Nov 17, 2017 3:42 pm
by Gfast2
Hi ESP-IDF,

Has someone tried do OTA through .bin file from SD card?

I've tried with my own partition table or as OTA Example shown factory partion + two OTA partition without luck... :roll:

Code: Select all

I (90) SD_CARD: Starting OTA example...
I (96) SD_CARD: Running partition type 0 subtype 0 (offset 0x00010000)
I (104) SD_CARD: Writing to partition subtype 16 at offset 0x110000
I (115) SD_CARD: esp_ota_begin succeeded
I (117) SD_CARD: Have written image length 1
I (118) SD_CARD: Have written image length 2
I (119) SD_CARD: Have written image length 3
I (124) SD_CARD: Have written image length 4
I (129) SD_CARD: Have written image length 5

... ...

I (732) SD_CARD: Have written image length 126
I (737) SD_CARD: Have written image length 127
I (742) SD_CARD: Connection closed, all packets received
I (747) SD_CARD: Total Write binary data length : 127
W (753) esp_image: image at 0x110000 has invalid SPI mode 202
E (759) esp_image: image at 0x110000 segment count 223 exceeds max 16
E (766) SD_CARD: esp_ota_end failed!
E (770) SD_CARD: Exiting task due to fatal error...

Re: can't OTA .bin file from SD card

Posted: Fri Nov 17, 2017 5:21 pm
by loboris
I have "OTA" from the file on SD Card included in my MycroPython port, it works without problems.

Re: can't OTA .bin file from SD card

Posted: Sat Nov 18, 2017 6:57 pm
by Gfast2
loboris wrote:I have "OTA" from the file on SD Card included in my MycroPython port, it works without problems.
Hi loboris,

Thanks for your message.

Yeh, yestern day I did successfully finish the job as the title described. What wrong was is only in my "fread" I exchanged two arguments' position, which burned my half day time. :lol:

Cheers

Gfast2

Re: can't OTA .bin file from SD card

Posted: Mon May 20, 2019 5:46 am
by zoro99
Hi Gfast2,

I am trying the same thing with fgets and it doesn't seem to read the bytes properly. Can you let me know how you read the bin file from the sd card?

Thanks

Re: can't OTA .bin file from SD card

Posted: Mon May 20, 2019 9:37 am
by ESP_igrr
zoro99: if by "same thing" you mean reading an OTA binary image, then consider using fread function instead of fgets. The latter is meant to be used for text files, while the former will also handle 0x00 bytes which can be found in a binary file.