diff --git a/partitions_custom_16mb.csv b/partitions_custom_16mb.csv new file mode 100644 index 000000000..1c48e6bbe --- /dev/null +++ b/partitions_custom_16mb.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000 +otadata, data, ota, 0xE000, 0x2000 +app0, app, ota_0, 0x10000, 0x7E0000 +app1, app, ota_1, 0x7F0000, 0x7E0000 +spiffs, data, spiffs, 0xFD0000, 0x30000 diff --git a/partitions_custom.csv b/partitions_custom_4mb.csv similarity index 100% rename from partitions_custom.csv rename to partitions_custom_4mb.csv diff --git a/platformio.ini b/platformio.ini index ad8169a73..6c70de7f1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -49,7 +49,7 @@ extra_scripts = pre:pio-scripts/patch_apply.py post:pio-scripts/create_factory_bin.py -board_build.partitions = partitions_custom.csv +board_build.partitions = partitions_custom_4mb.csv board_build.filesystem = littlefs board_build.embed_files = webapp_dist/index.html.gz @@ -75,6 +75,16 @@ board = esp32dev build_flags = ${env.build_flags} +[env:generic_esp32_16mb_psram] +board = esp32dev +board_build.flash_mode = qio +board_build.partitions = partitions_custom_16mb.csv +board_upload.flash_size = 16MB +build_flags = ${env.build_flags} + -DBOARD_HAS_PSRAM + -mfix-esp32-psram-cache-issue + + [env:generic_esp32c3] board = esp32-c3-devkitc-02 custom_patches = ${env.custom_patches},esp32c3 diff --git a/src/WebApi_sysstatus.cpp b/src/WebApi_sysstatus.cpp index 7bf2b73c1..11bd29c20 100644 --- a/src/WebApi_sysstatus.cpp +++ b/src/WebApi_sysstatus.cpp @@ -41,6 +41,8 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request) root["heap_used"] = ESP.getHeapSize() - ESP.getFreeHeap(); root["heap_max_block"] = ESP.getMaxAllocHeap(); root["heap_min_free"] = ESP.getMinFreeHeap(); + root["psram_total"] = ESP.getPsramSize(); + root["psram_used"] = ESP.getPsramSize() - ESP.getFreePsram(); root["sketch_total"] = ESP.getFreeSketchSpace(); root["sketch_used"] = ESP.getSketchSize(); root["littlefs_total"] = LittleFS.totalBytes(); diff --git a/src/main.cpp b/src/main.cpp index c3aea787d..62440afbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,9 +24,13 @@ #include #include #include +#include void setup() { + // Move all dynamic allocations >512byte to psram (if available) + heap_caps_malloc_extmem_enable(512); + // Initialize serial output Serial.begin(SERIAL_BAUDRATE); #if ARDUINO_USB_CDC_ON_BOOT diff --git a/webapp/src/components/MemoryInfo.vue b/webapp/src/components/MemoryInfo.vue index 132d63ca1..b9153dac6 100644 --- a/webapp/src/components/MemoryInfo.vue +++ b/webapp/src/components/MemoryInfo.vue @@ -14,6 +14,8 @@ +