-->
Page 1 of 1

Memory kind on ESP8266... How many? Stack, RAM, heap, SPIFFS

PostPosted: Sun Jun 30, 2019 2:24 pm
by sblantipodi
As title.
How much "memory kind" I have on an ESP8266 D1 Mini board with 4MB of Flash?

Is flash and SPIFFS the same thing?
How much RAM I have?
What is stack and what heap?

Can you clarify please?

What kind of memory I use when I run an arduino sketch on my ESP?
I can use SPIFFS if I store something non valatile but where the program run? in ram?

How many RAM I have?

Re: Memory kind on ESP8266... How many? Stack, RAM, heap, SP

PostPosted: Mon Jul 01, 2019 9:53 am
by rudy
The external flash memory is where our programs reside. Not all the space can conveniently be used for program execution. 1MB is the normal limit. (no paging schemes) The remainder can be used for other things. The most common is as a file system. With the Arduino framework EEPROM is an emulation that uses some of the flash. There is no real eeprom on the ESP8266.
The reason we cannot have more than 1MB of code in flash has to do with a hardware limitation. Flash cache hardware on the ESP8266 only allows mapping 1MB of code into the CPU address space at any given time.


200kb of ROM (for permanent library functions); 32kb sram; 80kb dram


stack (dynamic memory allocated by program control flow) and heap (dynamic memory allocated by function calls), as well as statically allocated memory (allocated at compile time).


Some interesting information here.
https://esp8266life.wordpress.com/2019/ ... ys-memory/