Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By engrkhawaja
#86914 Thanks for response.

In Short when I select OTA ~1019KB It can do OTA of full program storage space. Maximum is 1044464 bytes.

512KB OTA will mean half of the program storage space? and 1019KB means full program storage space?

Do I need to select FS Size for the OTA?

I am bit confused here that how will it work.
User avatar
By engrkhawaja
#86916 Thanks for response, I came here after reading docs.

Let me explain what I understood so far

No matter what flash size >1MB I used for ESP8266 Program Space remain fixed 1MB which is about 1044464 bytes. In case of 1MB or less Flash. OTA can only be done if sketch size is less than half to total program space.

Correct?

For OTA of 1044464 bytes I need atleast 2MB Flash chip or greater If I need SPIFF.

Correct?
User avatar
By Pablo2048
#86917
engrkhawaja wrote:No matter what flash size >1MB I used for ESP8266 Program Space remain fixed 1MB which is about 1044464 bytes. In case of 1MB or less Flash. OTA can only be done if sketch size is less than half to total program space.

Correct?

No. The ESP8266 can execute code only in cacheable region. Cacheable region size is 1MB - so this is where the limit of 1MB executable code in one time came from. Start of this region is programmable, but actually I never seen switching of this area IIRC. To upload new binary via OTA you need enough space in flash for it. You can simplify it by expecting, that it is half of total available flash, but it's not true - there are some another regions of memory, reserved for their particulat uses - for example SPIFFS, EEPROM and SDK flash area. So the right answer is - OTA is available only if flash space between end of your actually running firmware and next memory region (in most cases this is begin of the SPIFFS area) is enough to store the new firmware. This is why I did 2M/2M division in 4MB ESP modules.