Chat freely about anything...

User avatar
By spaceman
#83703 Hi all

I often see this, regarding an ESP8266 module's Flash memory:

- 16 Mbit Flash, Map: 512KB+512KB
- 16 Mbit Flash, Map: 1024KB+1024KB
- 32 Mbit Flash, Map: 1024KB+1024KB

What does this Map do?
And why is it specified in 2 parts?

And another question regarding the Flash memory:
What does the "-C1" suffix mean?

You can see for example "32Mbit", and "32Mbit-C1" - what's the difference?


Thank you
User avatar
By davydnorris
#83716 The map describes the total memory and available flash regions - the ESP8266 can automatically map and address up to 1M of flash for program space (you can address the rest manually in code using SPI routines), so when you see something like:

16 Mbit Flash, Map: 512KB+512KB
16 Mbit Flash, Map: 1024KB+1024KB

this means your module has 2MB (or 16Mbit) of flash installed, and you can choose to set that up as two 512KB partitions (with 1MB space free for your program to use for your own data via SPI routines), or as two 1024MB partitions with no formal space set aside for user data.

When you are using the flash application, the 1024MB mode is chosen by adding -C1 to the size.
User avatar
By spaceman
#83718 Thank you for this answer.

Allow me to verify If I understand..

If I have an ESP8266 module with 16Mbit (meaning 2MB),
then you say I can choose between 2 options:
1) 512MB+512MB, which leaves another 1MB Free for me to use for storage of whatever I wish
2) 1024MB+1024MB, which uses the whole 2MB, and doesn't leave a Free storage like before

In that case,
what is the difference between the first 512MB and the second 512MB (or the first 1024MB and the second 1024MB) in the map?
It always comes in 2 parts..

One of them has to be the compiled Program code (binary).. So what is the second one?
User avatar
By davydnorris
#83727 The standard ESP8266 boot loader lets you set up Over The Air updates, which require two program partitions. The bootloader can be told to boot from one partition, and then you can download, store and verify a new flash into the other one via the Internet. Then you set the new active partition and reboot the device.

If you don't use OTA, then you would typically flash your program into the first 512 or 1024 partition, and use the rest for user data.

There is also a much more advanced bootloader caller rboot, which allows more than two partitions, so something like 512+512+512 is possible

It's also worth mentioning that if your code only takes up 700K, a 1024+1024 configuration will give you 300K of user data space. Changes in the 3.x SDKs added a partition table that formally defines this in the code and will stop you trashing your data by overwriting it with program