8000 micropython task: allocate internal ram · pycom/pycom-micropython-sigfox@b596cea · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit b596cea

Browse files
gijsiopeter-pycom
authored andcommitted
micropython task: allocate internal ram
malloc() may silently allocate external ram if it can't find enough internal ram and then we only get a core dump from an assert in xTaskCreate
1 parent 39de84e commit b596cea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

esp32/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void app_main(void) {
173173
micropy_lpwan_dio_pin_num = 23;
174174
micropy_lpwan_dio_pin = &pin_GPIO23;
175175

176-
mpTaskStack = malloc(MICROPY_TASK_STACK_SIZE_PSRAM);
176+
mpTaskStack = heap_caps_malloc(MICROPY_TASK_STACK_SIZE_PSRAM, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
177177

178178
// create the MicroPython task
179179
mpTaskHandle =
@@ -196,7 +196,7 @@ void app_main(void) {
196196
micropy_lpwan_dio_pin_num = 23;
197197
micropy_lpwan_dio_pin = &pin_GPIO23;
198198

199-
mpTaskStack = malloc(MICROPY_TASK_STACK_SIZE);
199+
mpTaskStack = heap_caps_malloc(MICROPY_TASK_STACK_SIZE, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
200200

201201
// create the MicroPython task
202202
mpTaskHandle =

0 commit comments

Comments
 (0)
0