CPU Startup Fails When Using Heap Task Tracking
Posted: Mon Jul 28, 2025 5:22 pm
MCU: ESP32 Pico D4
IDF: 5.5
I am attempting to track a heap issue in the application we develop. I noticed in the recent release we can track heap usage on a per task basis.
I have deployed the example code https://github.com/espressif/esp-idf/tr ... g/advanced to the board and this works fine.
Next step is to enable the trace facility in out application by setting the CONFIG_HEAP_TASK_TRACKING variable and to add code to dump the heap task information.
When I do this I find that the system fails to start crashing almost immediately.
Using the back trace I see the following:
The only non-standard thing I have done is to place the heap code into flash as we are running low on IRAM.
Any thoughts on where I go diagnosing this issue?
Regards,
Mark
IDF: 5.5
I am attempting to track a heap issue in the application we develop. I noticed in the recent release we can track heap usage on a per task basis.
I have deployed the example code https://github.com/espressif/esp-idf/tr ... g/advanced to the board and this works fine.
Next step is to enable the trace facility in out application by setting the CONFIG_HEAP_TASK_TRACKING variable and to add code to dump the heap task information.
When I do this I find that the system fails to start crashing almost immediately.
Using the back trace I see the following:
Code: Select all
0x40091d86: xTaskCheckForTimeOut at /Users/username/esp/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4178
0x40090263: xQueueSemaphoreTake at /Users/username/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1812
0x400d5371: heap_caps_update_per_task_info_alloc at /Users/username/esp/esp-idf/components/heap/heap_task_info.c:279
0x400d5994: heap_caps_aligned_alloc_base at /Users/username/esp/esp-idf/components/heap/heap_caps_base.c:179 (discriminator 2)
0x400d59b9: heap_caps_malloc_base at /Users/username/esp/esp-idf/components/heap/heap_caps_base.c:202
0x400d40e1: heap_caps_malloc at /Users/username/esp/esp-idf/components/heap/heap_caps.c:84
0x40090889: pvPortMalloc at /Users/username/esp/esp-idf/components/freertos/heap_idf.c:55
0x4008feb3: xQueueGenericCreate at /Users/username/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:545
0x40090078: xQueueCreateMutex at /Users/username/esp/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:669
0x4009438f: esp_log_impl_lock_timeout at /Users/username/esp/esp-idf/components/log/src/os/log_lock.c:37
0x401ac963: log_level_get at /Users/username/esp/esp-idf/components/log/src/log_level/tag_log_level/tag_log_level.c:65
0x4009447a: esp_log_level_get_timeout at /Users/username/esp/esp-idf/components/log/src/log_level/tag_log_level/tag_log_level.c:102
0x400d3e95: esp_log_is_tag_loggable at /Users/username/esp/esp-idf/components/log/src/log_level/log_level.c:53
0x40094343: esp_log_va at /Users/username/esp/esp-idf/components/log/src/log.c:41 (discriminator 1)
(inlined by) esp_log at /Users/username/esp/esp-idf/components/log/src/log.c:88 (discriminator 1)
0x400d5251: create_new_heap_stats_entry at /Users/username/esp/esp-idf/components/heap/heap_task_info.c:118 (discriminator 1)
(inlined by) create_new_task_stats_entry at /Users/username/esp/esp-idf/components/heap/heap_task_info.c:213 (discriminator 1)
0x400d53a1: heap_caps_update_per_task_info_alloc at /Users/username/esp/esp-idf/components/heap/heap_task_info.c:319
0x400d4593: heap_caps_init at /Users/username/esp/esp-idf/components/heap/heap_caps_init.c:211 (discriminator 2)
0x400d45f3: __esp_system_init_fn_init_heap at /Users/username/esp/esp-idf/components/heap/heap_caps_init.c:27
0x400d34db: do_system_init_fn at /Users/username/esp/esp-idf/components/esp_system/startup.c:132
0x400d350e: do_core_init at /Users/username/esp/esp-idf/components/esp_system/startup.c:170
(inlined by) start_cpu0_default at /Users/username/esp/esp-idf/components/esp_system/startup.c:203
0x40081121: call_start_cpu0 at /Users/username/esp/esp-idf/components/esp_system/port/cpu_start.c:836 (discriminator 1)
0x40079236: ?? ??:0
Any thoughts on where I go diagnosing this issue?
Regards,
Mark