Static task works, dynamic not - Not enough memory?
Posted: Mon Apr 11, 2022 8:46 am
Hi,
I have running code but for some time now adding new line of code (e.g. MDF_LOGI or watchdog) causes problem with initialization of program when I load wifi configuration, ... etc. from NVS.
I needed to add watchdogs to both tasks.
I guess its a problem with memory because I changed one task from dynamic to static and it works fine again.
So I have 3 cases:
1. Adding watchdog to one task - WORKS
2. Adding watchdog to second task - DOESN'T WORK (compiles but fails during initialization from NVS)
3. Adding watchdog to second task and changing it to static- WORKS AGAIN (compiles but fails during initialization from NVS)
Is it a problem with memory? If so which memory is responislble for that and how can I check it?
Thanks in advance and best regards,
Mateusz
I have running code but for some time now adding new line of code (e.g. MDF_LOGI or watchdog) causes problem with initialization of program when I load wifi configuration, ... etc. from NVS.
I needed to add watchdogs to both tasks.
I guess its a problem with memory because I changed one task from dynamic to static and it works fine again.
So I have 3 cases:
1. Adding watchdog to one task - WORKS
Code: Select all
xTaskCreate(communication_task, "communication_task", 4 * 1024, NULL, 6, NULL);
xTaskCreate(VL53L0X_task, "VL53L0X_task", 4 * 1024, NULL, 4, &xHandle_VL53L0X);
MDF_ERROR_ASSERT( esp_task_wdt_init(100,1) );
MDF_ERROR_ASSERT( esp_task_wdt_add(xHandle_VL53L0X) );
Code: Select all
xTaskCreate(communication_task, "communication_task", 2 * 1024, NULL, 6, &xHandle_communication);
xTaskCreate(VL53L0X_task, "VL53L0X_task", 4 * 1024, NULL, 4, &xHandle_VL53L0X);
MDF_ERROR_ASSERT( esp_task_wdt_init(100,1) );
MDF_ERROR_ASSERT( esp_task_wdt_add(xHandle_communication) );
MDF_ERROR_ASSERT( esp_task_wdt_add(xHandle_VL53L0X) );
Code: Select all
xHandle_communication = xTaskCreateStatic(
communication_task,
"communication_task",
4 * 1024,
( void * ) 1,
6,
xStack,
&xTaskBuffer );
xTaskCreate(VL53L0X_task, "VL53L0X_task", 4 * 1024, NULL, 4, &xHandle_VL53L0X);
MDF_ERROR_ASSERT( esp_task_wdt_init(100,1) );
MDF_ERROR_ASSERT( esp_task_wdt_add(xHandle_communication) );
MDF_ERROR_ASSERT( esp_task_wdt_add(xHandle_VL53L0X) );
Is it a problem with memory? If so which memory is responislble for that and how can I check it?
Thanks in advance and best regards,
Mateusz