Hi,
My code is compiling properly for ESP8266 but if it fails for ESP32
See the error and platformio.ini below.
How can I troubleshoot and fix it?
Retrieving maximum program size .pio/build/esp32/firmware.elf
Checking size .pio/build/esp32/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
Error: The program size (1370149 bytes) is greater than maximum allowed (1310720 bytes)
RAM: [== ] 16.5% (used 53952 bytes from 327680 bytes)
Flash: [==========]*** [checkprogsize] Explicit exit, status 1
104.5% (used 1370149 bytes from 1310720 bytes)
========================================== [FAILED] Took 29.46 seconds ==========================================
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = esp8266
[env]
lib_archive = false
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
lib_deps =
hieromon/PageBuilder@^1.5.6
hieromon/AutoConnect@^1.4.2
bblanchon/ArduinoJson@^6.20.1
build_flags =
-DAC_DEBUG
-DAC_USE_LITTLEFS
-DPB_USE_LITTLEFS
board_build.filesystem = littlefs
[env:esp32_wokwi]
platform = espressif32
framework = arduino
board = esp32dev
lib_deps =
stevemarple/AsyncDelay@^1.1.2
moononournation/GFX Library for Arduino@^1.3.1
adafruit/Adafruit ILI9341@^1.5.12
mathertel/OneButton@^2.0.3
hieromon/AutoConnect@^1.4.2
adafruit/Adafruit SSD1306@^2.5.7
build_flags =
-D WOKWI_SIMULATION
-D PLATFORM_ESP32
-D SERIAL_SCREEN
debug_build_flags = -Os # optimize for size
board_upload.flash_size = 8MB
board_upload.maximum_size = 8388608
board_build.partitions = huge_app.csv
[env:esp32]
platform = espressif32
framework = arduino
board = esp32dev
lib_deps =
stevemarple/AsyncDelay@^1.1.2
moononournation/GFX Library for Arduino@^1.3.1
adafruit/Adafruit ILI9341@^1.5.12
mathertel/OneButton@^2.0.3
hieromon/PageBuilder@^1.5.6
hieromon/AutoConnect@^1.4.2
bblanchon/ArduinoJson@^6.20.1
lvgl=https://github.com/lvgl/lvgl/archive/refs/tags/v8.2.0.zip
lv_drivers=https://github.com/lvgl/lv_drivers/archive/refs/tags/v8.2.0.zip
adafruit/Adafruit SSD1306@^2.5.7
build_flags =
${env.build_flags}
-D LV_LOG_PRINTF=1
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_DRV_NO_CONF
-D LV_FONT_MONTSERRAT_14=1
-D LV_FONT_MONTSERRAT_20=1
-D LV_FONT_MONTSERRAT_42=1
-D LV_COLOR_16_SWAP
-D LV_MEM_CUSTOM=1
-D LV_MEM_SIZE="(128U * 1024U)"
-D LV_CONF_SKIP
-D LV_CONF_INCLUDE_SIMPLE
-D LV_USE_DEMO_WIDGETS=1
-D SERIAL_SCREEN
-D ARDUINO_ARCH_ESP32
[env:esp8266]
platform = espressif8266
framework = arduino
board = nodemcuv2
lib_deps =
stevemarple/AsyncDelay@^1.1.2
moononournation/GFX Library for Arduino@^1.3.1
adafruit/Adafruit ILI9341@^1.5.12
mathertel/OneButton@^2.0.3
hieromon/PageBuilder@^1.5.6
hieromon/AutoConnect@^1.4.2
bblanchon/ArduinoJson@^6.20.1
lvgl=https://github.com/lvgl/lvgl/archive/refs/tags/v8.2.0.zip
lv_drivers=https://github.com/lvgl/lv_drivers/archive/refs/tags/v8.2.0.zip
adafruit/Adafruit SSD1306@^2.5.7
build_flags =
${env.build_flags}
-D LV_LOG_PRINTF=1
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_DRV_NO_CONF
-D LV_FONT_MONTSERRAT_14=1
-D LV_FONT_MONTSERRAT_20=1
-D LV_FONT_MONTSERRAT_42=1
-D LV_COLOR_16_SWAP
-D LV_MEM_CUSTOM=1
-D LV_MEM_SIZE="(128U * 1024U)"
-D LV_CONF_SKIP
-D LV_CONF_INCLUDE_SIMPLE
-D LV_USE_DEMO_WIDGETS=1
-D SERIAL_SCREEN
-D PLATFORM_ESP8266
I am using AutoConnect and it has the code like this.(from their own example)
#include <AutoConnect.h>
#ifdef AUTOCONNECT_USE_LITTLEFS
#include <LittleFS.h>
#if defined(ARDUINO_ARCH_ESP8266)
FS& FlashFS = LittleFS;
#elif defined(ARDUINO_ARCH_ESP32)
fs::LittleFSFS& FlashFS = LittleFS;
#endif
#else
#include <FS.h>
#include <SPIFFS.h>
fs::SPIFFSFS& FlashFS = SPIFFS;
#endif
#include <ArduinoJson.h>
Compilation (start)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.0.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20006.221224 (2.0.6)
- tool-esptoolpy @ 1.40400.0 (4.4.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Converting AirconnController.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 48 compatible libraries