Task not launching even with plenty of free internal RAM
Posted: Mon May 25, 2020 11:50 pm
I am running low on internal RAM for task stack usage, but I have around 10000 bytes available and want to launch a task with a stack of only 3072 bytes. However, the task creation fails and returns -1 (memory). Any idea why this would happen?
These are the results on which I base my numbers. At the time I try to call task create:
heap_caps_get_free_size(MALLOC_CAP_INTERNAL); 10428
heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL); 9808
Other info:
IDF is v4.0 release/stable
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
Project is using WiFI, NimBLE and esp-azure
Build-time size info (which does not include runtime-only heap) is:
These are the results on which I base my numbers. At the time I try to call task create:
heap_caps_get_free_size(MALLOC_CAP_INTERNAL); 10428
heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL); 9808
Code: Select all
ESP_LOGI(TAG, "Launch special LED test");
if (pdPASS != xTaskCreate(led_test_task,"led v5 test", 3072, NULL, 6, &hTsk_LedTest) )
{
ESP_LOGE(TAG, "LED test task creation failed");
}
IDF is v4.0 release/stable
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
Project is using WiFI, NimBLE and esp-azure
Build-time size info (which does not include runtime-only heap) is:
Code: Select all
idf.py size-components
Scanning dependencies of target size-components
Total sizes:
DRAM .data size: 21980 bytes
DRAM .bss size: 96464 bytes
Used static DRAM: 118444 bytes ( 6136 available, 95.1% used)
Used static IRAM: 121095 bytes ( 9977 available, 92.4% used)
Flash code: 1051803 bytes
Flash rodata: 304700 bytes
Total image size:~1499578 bytes (.bin may be padded larger)