ESP8266 MMU increase heap

Yes that definitely works. If I do

[env:esp8266]
platform = espressif8266
board = nodemcuv2
framework = arduino
platform_packages =
   framework-arduinoespressif8266@https://github.com/esp8266/Arduino.git#3.0.0
   mcspr/toolchain-xtensa@~5.100200.0
build_flags = -DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP
monitor_speed = 74880
upload_speed = 921600

with code

#include <Arduino.h>
#include <umm_malloc/umm_heap_select.h>

void setup() 
{
  Serial.begin(74880);
  HeapSelectIram ephemeral;
  Serial.printf("IRAM free: %6d bytes\r\n", ESP.getFreeHeap());
  {
    HeapSelectDram ephemeral;
    Serial.printf("DRAM free: %6d bytes\r\n", ESP.getFreeHeap());
  }
}

void loop() {
  // put your main code here, to run repeatedly:
}

I get

IRAM free:  21592 bytes
DRAM free:  52336 bytes

^~^ so the options are totally usable.

As you can see in here they also already updated the platformio-build.py script for PlatformIO integration.

1 Like