can't OTA .bin file from SD card

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

can't OTA .bin file from SD card

Postby Gfast2 » Fri Nov 17, 2017 3:42 pm

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...

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

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

Postby loboris » Fri Nov 17, 2017 5:21 pm

I have "OTA" from the file on SD Card included in my MycroPython port, it works without problems.

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

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

Postby Gfast2 » Sat Nov 18, 2017 6:57 pm

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

zoro99
Posts: 1
Joined: Mon May 20, 2019 5:43 am

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

Postby zoro99 » Mon May 20, 2019 5:46 am

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

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Mon May 20, 2019 9:37 am

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.

Who is online

Users browsing this forum: No registered users and 103 guests