Skip to content

Commit 5424af1

Browse files
Merge pull request #601 from espressif/fix/lvgl_task_stack
fix(esp_lvgl_port): Place LVGL task stack to internal RAM
2 parents 3f92203 + f67858c commit 5424af1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

components/esp_lvgl_port/include/esp_lvgl_port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typedef struct {
6767
.task_stack = 7168, \
6868
.task_affinity = -1, \
6969
.task_max_sleep_ms = 500, \
70-
.task_stack_caps = MALLOC_CAP_DEFAULT, \
70+
.task_stack_caps = MALLOC_CAP_INTERNAL | MALLOC_CAP_DEFAULT, \
7171
.timer_period_ms = 5, \
7272
}
7373

components/esp_lvgl_port/src/lvgl8/esp_lvgl_port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ esp_err_t lvgl_port_init(const lvgl_port_cfg_t *cfg)
7878
ESP_GOTO_ON_FALSE(lvgl_port_ctx.task_mux, ESP_ERR_NO_MEM, err, TAG, "Create LVGL task sem fail!");
7979

8080
BaseType_t res;
81-
const uint32_t caps = cfg->task_stack_caps ? cfg->task_stack_caps : MALLOC_CAP_DEFAULT; // caps cannot be zero
81+
const uint32_t caps = cfg->task_stack_caps ? cfg->task_stack_caps : MALLOC_CAP_INTERNAL | MALLOC_CAP_DEFAULT; // caps cannot be zero
8282
if (cfg->task_affinity < 0) {
8383
res = xTaskCreateWithCaps(lvgl_port_task, "taskLVGL", cfg->task_stack, NULL, cfg->task_priority, &lvgl_port_ctx.lvgl_task, caps);
8484
} else {

components/esp_lvgl_port/src/lvgl9/esp_lvgl_port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ esp_err_t lvgl_port_init(const lvgl_port_cfg_t *cfg)
8585
ESP_GOTO_ON_FALSE(lvgl_port_ctx.lvgl_events, ESP_ERR_NO_MEM, err, TAG, "Create LVGL Event Group fail!");
8686

8787
BaseType_t res;
88-
const uint32_t caps = cfg->task_stack_caps ? cfg->task_stack_caps : MALLOC_CAP_DEFAULT; // caps cannot be zero
88+
const uint32_t caps = cfg->task_stack_caps ? cfg->task_stack_caps : MALLOC_CAP_INTERNAL | MALLOC_CAP_DEFAULT; // caps cannot be zero
8989
if (cfg->task_affinity < 0) {
9090
res = xTaskCreateWithCaps(lvgl_port_task, "taskLVGL", cfg->task_stack, xTaskGetCurrentTaskHandle(), cfg->task_priority, &lvgl_port_ctx.lvgl_task, caps);
9191
} else {

0 commit comments

Comments
 (0)