-->
Page 1 of 3

OTA:~1019KB vs OTA:~512KB Difference?

PostPosted: Sun May 03, 2020 9:59 pm
by engrkhawaja
Hi,
My Sketch Size is about 517032 bytes. I think it might increase after adding few more features.

So it certainly doesn't comply with OTA Size of 512KB, but will the OTA work on ~1019Kb?

As I don't see any difference in compilation.

Please guide the affect of 2 above.

Thanks

Re: OTA:~1019KB vs OTA:~512KB Difference?

PostPosted: Sun May 03, 2020 10:04 pm
by engrkhawaja
If I compile using 4MB (FS:2MB) or 4MB (FS:3MB) both shows same result
Sketch uses 517032 bytes (49%) of program storage space. Maximum is 1044464 bytes.

Re: OTA:~1019KB vs OTA:~512KB Difference?

PostPosted: Mon May 04, 2020 12:44 am
by JurajA
why would file system or OTA partition size selection do have something with compilation?
the maximum application size for esp8266 is 1MB, so on a 4 MB flash a 1 MB partition is always reserved for code

Re: OTA:~1019KB vs OTA:~512KB Difference?

PostPosted: Mon May 04, 2020 2:25 am
by btidey
It won't affect the compilation.

The difference is that in order to do OTA with program sizes up to 1MB the Flash memory has to be partioned in a way that allows 2 1MB programs to be present (one is the current one and one is the new one being downloaded.

This means that with a 4MB flash size then at least 2MB must be allocated to program space. On Arduino IDE originally this meant selecting the 3MB PS 1M SPIFFS, but more recent versions allows selecting 2MB PS 2MB SPIFFS which still allows for a maximum 1MB program size while leaving more free for SPIFFS.