I switched from Arduino IDE to PlatformIO a half year ago. PlatformIO is a great product. I was able to structure my code for my ESP8266 and ESP32’s in a way that wasn’t possible with Arduino IDE.
Also the compilations are very fast and gives me a lot more control.
Hence I have a question. I want to increase the heap, to try to use the bear ssl client with a extensive code for my esp8266. I run a standard webserver in the esp and some advances features for processing sensors, actuators etc.
But for using a ssl client to communicate securely to my domotic solution, I run out of heap.
In the arduino IDE there is a option, to customise the memory allocation, but I can’t find the way to do that with PlatformIO.
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
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.