I know the ESP8266 is end-of-life but I have a bunch version 12F (4MB flash size) lying around that I would like to use for a project involving LittleFS Data Upload.
In the ESP8266 (v3.1.2 core) there are a number of options for partition configuration.
Amongst them:
Flash Size: "4MB (FS:3MB OTA:~512kB)"
or
Flash Size: "4MB (FS:2MB OTA:~1019kB)"
or
Flash Size: "4MB (FS:1MB OTA:~1019kB)"
What is the meaning/purpose/.. of these parameters and how do they construct the partitions?
Why, with 4MB flash size, is there a choice for "FS:1MB", or 2MB or 3MB?
with the 3MB setting the remaining flash available for the App is 1MB, which means that any Sketch which you would want to update OTA will be limited to 512KB in size.
The 2MB setting will provide you with the maximum 1MB sketch size also for OTA updates, and i am also not sure what to do with the remaining 1MB for the 1MB FS setting. You will have some 'ghost' part of the partition that way. Mind you i think it is only when programming the ESP through the Arduino IDE that the sketch size is really limited to 1MB.
1 Like
Do you mean the Arduino IDE limits the ESP8266 sketch size always to 1MB?
So if total ESP8266 flash size is 4MB, then the FS = 3MB leaves 1MB for actual sketch size? And 512kB for OTA? What happens with the remainder of the FS = 3MB?
Yes the Arduino IDE in combination with the esp8266 core is limited to 1MB maximum sketch size, but as far as i know there are other ways to create a bigger App, though i can not provide you with the specifics.
No if the flash size is 4MB, and the FS takes 3MB, that leaves 1MB for the sketch, but if you want to be able to use OTA updates, both the running sketch and the new sketch will have to be loaded into Flash at the same time, that limits the sketch size to 512KB with OTA still available.
My normal setting with 4MB Flash would be FS = 2MB, this leaves 2MB for sketch, so the maximum 1MB sketch size can be used and OTA is available as well.
I use ESP-01 boards quite a bit and their 1MB flash size complicates matters even more. Just by default the sketch size is limited to 512KB if i want to have OTA updates available (which i do of course) and some small FS for storing things as well. I have resorted to using an older core version which results in a smaller sketch size but this is only for 1MB flash that this solution is really required.
A 1MB sketch is really quite big and if there is a lot of static data involved the FS can be used for it (like webpages and images and these kind of things) The FS can be updated through a wired connection directly from the IDE or by use of HTML upload OTA, but that requires the code to support that.
1 Like
@Deva_Rishi Many thanks for those extensive replies. They are very helpful!