Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cpu/esp32/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ static NORETURN void IRAM system_startup_cpu0(void)
puf_sram_init((uint8_t *)&_sheap, SEED_RAM_LEN);
#endif

#if IS_USED(MODULE_ESP_IDF_HEAP)
/* init heap */
heap_caps_init();
if (IS_ACTIVE(ENABLE_DEBUG)) {
ets_printf("Heap free: %u byte\n", get_free_heap_size());
}
#endif

/* initialize system call tables of ESP32x rom and newlib */
syscalls_init();

Expand Down Expand Up @@ -206,14 +214,6 @@ static NORETURN void IRAM system_startup_cpu0(void)

LOG_STARTUP("PRO cpu is up (single core mode, only PRO cpu is used)\n");

#if IS_USED(MODULE_ESP_IDF_HEAP)
/* init heap */
heap_caps_init();
if (IS_ACTIVE(ENABLE_DEBUG)) {
ets_printf("Heap free: %u byte\n", get_free_heap_size());
}
#endif

/* init esp_timer implementation */
esp_timer_early_init();

Expand Down
3 changes: 3 additions & 0 deletions cpu/esp_common/freertos/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ void vTaskDelete(TaskHandle_t xTaskToDelete)
DEBUG("%s pid=%d task=%p\n", __func__, thread_getpid(), xTaskToDelete);

uint32_t pid = (uint32_t)xTaskToDelete;
if (pid == 0) {
pid = thread_getpid();
}
assert(pid_is_valid(pid));

/* remove the task from scheduling */
Expand Down