-
• #2
Just a hunch: ESP8266's flash is divided to multiple parts: Running code, SPIFS, OTA partition, etc. My guess is that's why you only see that much free flash.
There are compiler flags to set flash partition on the ESP8266, and I think separate compiler options to reserve space for Espruino's storage. -
• #3
Hi @maze1980,
Storage is using save pages in the memory mapped area.
A 4MB build will give you 48x4096 bytes, which is exactly 196608 byte.require("ESP8266").getFreeFlash()
returns all other memory areas as defined in source code. For working with those areas use the build in Flash Library and the FlashEEPROM module. -
• #4
Thanks for the info.
Is is theoretically possible to extend the Storage module to use all available flash areas, or are there technical limitations?
I've compiled a firmware with STORAGE enabled, but putting more and more pages on the ESP8266 it seems like there's not even 1 MB of free storage available while flash is almost 2 MB:
Somehow I expected the STORAGE module to use all available flash storage, not just the block where the program and wifi data is stored. Is it the intended behavior, or a bug in my build?