I was getting the dreaded “your code will not fit error“ on my project PlatformIO, LVGL & TFT_eSPI.
Using a 8 MB board (should be lots-a-room) I just swapped over to a 16MB board Should be fine.
Nope same error!!
my ini has
[env:esp32dev]
platform = espressif32 ;platformio/espressif32 ;espressif32
board = esp32dev
framework = arduino
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
monitor_speed = 115200
monitor_filters = colorize
upload_protocol = esptool
monitor_echo = yes
build_flags = -Wl,-Map,output.map
I have read and read on this issue but there seems to be no real answer
please help
You mean the default_16MB.csv? That’s flash. It’s complaining about Data RAM not being enough. Does your board have PSRAM, like 4 or 8 MByte maybe?
You can easily get to that point if you misconfigure the buffer size for LVGL.
You can absolutely find out what is trying to take up so much RAM with the technique I showed in I would even be willing to bet it’s due to the same cause: Not configuring LV_MEM_SIZE properly.
Looking at my config, I see
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/** Size of memory available for `lv_malloc()` in bytes (>= 2kB) */
#define LV_MEM_SIZE (64 * 1024U) /**< [bytes] */
/** Size of the memory expand for `lv_malloc()` in bytes */
#define LV_MEM_POOL_EXPAND_SIZE 1 //was 0 Kim
what should I change?
That looks okay for a start, depending on what other allocations are made.
Go ahead and make the same linker script modifications in the post I’ve mentioned to produce a .map file, then analayze that or link it here.
Not quite sure what happened but compile is now working
Auto-detected flash size: 8MB
Flash will be erased from 0x00001000 to 0x00006fff…
Flash will be erased from 0x00008000 to 0x00008fff…
Flash will be erased from 0x0000e000 to 0x0000ffff…
Flash will be erased from 0x00010000 to 0x0017bfff…
SHA digest in image updated.
Compressed 23696 bytes to 15163…