esp32_arduino_sqlite3_lib
esp32_arduino_sqlite3_lib copied to clipboard
esp32 SPIRAM replacement for malloc
Is there an existing override in the library to use the external spiram of the esp32 for the heap? if not, is it possible for you to create a new one with the following:
#include "esp_heap_caps.h" #define SQLITE_MALLOC(x) heap_caps_malloc(x, MALLOC_CAP_SPIRAM) //modified was malloc #define SQLITE_FREE(x) heap_caps_free(x) //modified was free #define SQLITE_REALLOC(x,y) heap_caps_realloc((x),(y),MALLOC_CAP_SPIRAM) //modified was realloc
Hi, thank you for the suggestion. The question of allocating from PSRAM came up before this, but there does not seem to be a transparent way of doing this. There seems to be a config setting CONFIG_SPIRAM_USE=SPIRAM_USE_MALLOC here: https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/ but I am still trying to figure out how it can be integrated with the Arduino library. I will work on this and try to integrate it.