ESP8266 MMU increase heap

First of all, as someone who worked with an ESP8266 + TLS, connecting to some TLS websites is just impossible if they use big certificate chains and inefficient algorithms like RSA instead of ECC-based stuff, even if you have a little bit more memory, they’d need a lot more memory – some things are just out of reach for an ESP8266.

Second of all, the MMU feature is only available in the new 3.0.0 core for which PlatformIO doesn’t yet built-in support, see Arduino Core 3.0, when?. However, with certatin configuration options as outlined in this thread, it’s possible to get the 3.0.0 version.

Further if I read

correctly then the different MMU / heap options just boil down to adding a few macros to the build process, which we can do as well using build_flags.

So if you want the e.g. the 16KB cache + 48KB IRAM and 2nd Heap (shared) option, you would add the corresponding mmuflags as

build_flags = -DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP

to the platformio.ini.

I have not tested this at the moment.

The MMU options would be documented in Espressif 8266 — PlatformIO latest documentation but aren’t now; this is because PlatformIO officially supports only up to core version 2.7.4 and not the new 3.0.0 as of now. If PlatformIO updates, those options should be added.

1 Like