ModischFabrications / ModischMatrix

[ESP32 + RGB] Pretty Pixels on a homemade Matrix
2 stars 0 forks source link

Build & Formatting #3

Closed ModischFabrications closed 2 years ago

ModischFabrications commented 2 years ago
ModischFabrications commented 2 years ago

Seems like it's a problem of integrating external SPI RAM into local memory map: https://community.platformio.org/t/a-question-about-board-configuration-files-with-esp32/21877/6

Solution seems to be a menuconfig tool that doesn't work for me. The ominous sdkconfig file from the HUB75 examples might be a way.

ModischFabrications commented 2 years ago

https://docs.platformio.org/en/latest/platforms/espressif32.html#external-ram-psram -> sadly, same size as before.

ModischFabrications commented 2 years ago

"Auto-detected Flash size: 4MB" from upload log

ModischFabrications commented 2 years ago

Getting close now:

RAM: [== ] 15.9% (used 52152 bytes from 327680 bytes) Flash: [========= ] 93.2% (used 1221122 bytes from 1310720 bytes)

ModischFabrications commented 2 years ago

Went over now.

Seems like partition tables are used to increase usable space: https://github.com/platformio/platform-espressif32/issues/309

ModischFabrications commented 2 years ago

Great overview in https://github.com/espressif/arduino-esp32/issues/4551#issuecomment-762401988, seems like the full 4MB are already used, it's just partitioned into the different areas. Using no_ota.csv should save some space, that's probably enough.

ModischFabrications commented 2 years ago

build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue

are great, but they seem to be a board-specific thing and are set already. 4MB of this board seems to be onboard only, so this was a pointless search. Use

void printRAM(){ // useful to validate PSRAM fix is running Serial.printf("Total heap: %d\n", ESP.getHeapSize()); Serial.printf("Free heap: %d\n", ESP.getFreeHeap()); Serial.printf("Total PSRAM: %d\n", ESP.getPsramSize()); Serial.printf("Free PSRAM: %d\n", ESP.getFreePsram()); }

to check for size.