Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended memory settings in ESP8266 Arduino Core SDK v3.0.0 #201

Closed
mobizt opened this issue May 19, 2021 · 0 comments
Closed

Recommended memory settings in ESP8266 Arduino Core SDK v3.0.0 #201

mobizt opened this issue May 19, 2021 · 0 comments
Labels
ide config IDE configuration

Comments

@mobizt
Copy link
Owner

mobizt commented May 19, 2021

Arduino IDE

When you update the ESP8266 Arduino Core SDK to v3.0.0, the memory can be configurable from Arduino IDE board settings.

By default MMU option 1 was selected, the free Heap can be low and may not suitable for the SSL client usage in this library.

To increase the Heap, choose the MMU option 3, 16KB cache + 48KB IRAM and 2nd Heap (shared).

IDE config

More about MMU settings.
https://arduino-esp8266.readthedocs.io/en/latest/mmu.html

PlatformIO IDE

When Core SDK v3.0.0 becomes available in PlatformIO,

By default the balanced ratio (32KB cache + 32KB IRAM) configuration is used.

To increase the heap, PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED build flag should be assigned in platformio.ini.

At the time of writing, to update SDK to v3.0.0 you can follow these steps.

  1. In platformio.ini, edit the config as the following
[env:d1_mini]
platform = https://github.com/platformio/platform-espressif8266.git
build_flags = -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
board = d1_mini
framework = arduino
monitor_speed = 115200
  1. Delete this folder C:\Users\UserName\.platformio\platforms\espressif8266@src-?????????????
  2. Delete .pio and .vscode folders in your project.
  3. Clean and Compile the project.

The supportedd MMU build flags in PlatformIO.

  • PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
    16KB cache + 48KB IRAM (IRAM)

  • PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
    16KB cache + 48KB IRAM and 2nd Heap (shared)

  • PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM32_SECHEAP_NOTSHARED
    16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared)

  • PIO_FRAMEWORK_ARDUINO_MMU_EXTERNAL_128K
    128K External 23LC1024

  • PIO_FRAMEWORK_ARDUINO_MMU_EXTERNAL_1024K
    1M External 64 MBit PSRAM

  • PIO_FRAMEWORK_ARDUINO_MMU_CUSTOM
    Disables default configuration and expects user-specified flags

Test code for MMU

#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:
}
@mobizt mobizt added the ide config IDE configuration label May 19, 2021
@mobizt mobizt pinned this issue May 19, 2021
Repository owner locked and limited conversation to collaborators May 19, 2021
@mobizt mobizt changed the title Recommended memory config in ESP8266 Arduino Core SDK v3.0.0 Recommended memory settings in ESP8266 Arduino Core SDK v3.0.0 May 20, 2021
@mobizt mobizt closed this as completed May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ide config IDE configuration
Projects
None yet
Development

No branches or pull requests

1 participant