Skip to content

Using PSRAM

Phil Schatzmann edited this page Jun 8, 2023 · 6 revisions

ESpeak-ng is statically allocating quite some big memory arrays. In fact, it uses so much RAM, that there is not enough if you want to use WIFI on the ESP32. This static allocation is not good because it prevents that you can use PSRAM.

Therfore I introduced the ESPEAK_HEAP_HACK option that you can activate in arduino/config-espk.h.

To use PSRAM you need to

  • set ESPEAK_HEAP_HACK 1
  • activating PRSAM in the Arduino Tools Menu
  • define the PSRAM memory limit by calling heap_caps_malloc_extmem_enable(int limit); in the beginning of your Sketch: e.g. heap_caps_malloc_extmem_enable(256);
Clone this wiki locally