Skip to content

Use PSRAM with DMA #1

@chillymattster

Description

@chillymattster

Hi there,

I'm trying to understand this very helpful UserDemo to get prepared for my own project with a CoreS3.

Taking a deeper look at function m5gfx_lvgl_init, I wondered if there is a special reason to not use PSRAM in DMA mode for the lvgl buffers.
Currently the buffers are created like this:

void m5gfx_lvgl_init(void) {
    static lv_color_t *buf1 = (lv_color_t *)heap_caps_malloc(
        LCD_WIDTH * 80 * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);
    static lv_color_t *buf2 = (lv_color_t *)heap_caps_malloc(
        LCD_WIDTH * 80 * sizeof(lv_color_t), MALLOC_CAP_SPIRAM);

I wonder if it wouldn't be beneficial to make use of the ESP32-S3 DMA capabilities, like this:

void m5gfx_lvgl_init(void) {
    static lv_color_t *buf1 = (lv_color_t *)heap_caps_malloc(
        LCD_WIDTH * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM);
    static lv_color_t *buf2 = (lv_color_t *)heap_caps_malloc(
        LCD_WIDTH * 80 * sizeof(lv_color_t), MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM);

I'm not a pro developer, so unfortunately I cannot say if there would be more changes needed to use DMA but in general it seems to be a good idea for me to utilize the capabilities of the ESP32-S3 to reduce CPU load.

Any thoughts and hints or maybe even an updated version of this great demo are highly appreciated ☺️

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions