ESP32 PSRAM Watchdog error

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the FAQ and read the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.


What MCU/Processor/Board and compiler are you using?

ESP32-Wrover-E (Flash 16MB, PSRAM 4MB)

What LVGL version are you using?


What do you want to achieve?

Using Firebase and LVGL at the same time

What have you tried so far?

ESP32 is using Firebase and LVGL at the same time
An error called Memory allocation failed occurred
I bought a module with built-in PSRAM knowing that it was an error caused by insufficient Heap.

However, to enable PSRAM, the platform.ini has the following command
When I set and operate build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue, watchdogs occur indefinitely.

The same happens when you remove Firebase and use LVGL alone.

Change LV_MEM_CUSTOM to 0 in lv_conf.h through search
#define LV_MEM_POOL_INCLUDE “esp_heap_caps.h”
The #define LV_MEM_POOL_ALLOC(size) heap_caps_malloc(size, MALLOC_CAP_SPIRAM) setting has also been changed. This, too, continues to cause watchdogs.

Is there a problem I’m missing?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

#define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0
    /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
    #define LV_MEM_SIZE (48U * 1024U)          /*[bytes]*/

    /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
    #define LV_MEM_ADR 0     /*0: unused*/
    /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
    #if LV_MEM_ADR == 0
    #define LV_MEM_POOL_INCLUDE     "esp_heap_caps.h"
    #define LV_MEM_POOL_ALLOC(size) heap_caps_malloc(size, MALLOC_CAP_SPIRAM)

#else       /*LV_MEM_CUSTOM*/
    #define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
    #define LV_MEM_CUSTOM_ALLOC   malloc
    #define LV_MEM_CUSTOM_FREE    free
    #define LV_MEM_CUSTOM_REALLOC realloc
#endif     /*LV_MEM_CUSTOM*/

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

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

You write nothing how big buffers you try use, but i mean primary problem is platformio board config. You need choice one with psram or in project create folder boards and custom json file for your defi.
Example part

  "build": {
      "ldscript": "esp32_out.ld"
    "core": "esp32",
    "extra_flags": [
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "mcu": "esp32",