I have the following really simple test code:
#include <Arduino.h>
const char mybuffer[] PROGMEM = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
... ~300kb ...
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
};
void setup() {
Serial.begin(115200);
delay(4000);
Serial.println(strlen(mybuffer));
}
void loop() { }
without “mybuffer” the build process shows the following final data and program sizes for the esp32 and the esp8266 platform
Processing lolin32 (platform: espressif32@1.11.1; board: lolin32; framework: arduino)
DATA: [ ] 4.7% (used 15436 bytes from 327680 bytes)
PROGRAM: [== ] 16.5% (used 216509 bytes from 1310720 bytes)
Processing d1_mini (platform: espressif8266@2.3.2; board: d1_mini; framework: arduino)
DATA: [=== ] 32.8% (used 26876 bytes from 81920 bytes)
PROGRAM: [== ] 24.9% (used 260588 bytes from 1044464 bytes)
with “mybuffer” included
Processing lolin32 (platform: espressif32@1.11.1; board: lolin32; framework: arduino)
DATA: [ ] 4.7% (used 15436 bytes from 327680 bytes)
PROGRAM: [==== ] 39.4% (used 516593 bytes from 1310720 bytes)
Processing d1_mini (platform: espressif8266@2.3.2; board: d1_mini; framework: arduino)
DATA: [=== ] 32.8% (used 26876 bytes from 81920 bytes)
PROGRAM: [===== ] 53.7% (used 560900 bytes from 1044464 bytes)
I do not understand why Inspect shows 100% RAM usage, with “mybuffer” included, for the esp32 while for the esp8266 it shows 33% only and everything seams to be ok.