Hi,
I have wifi and ble in separate tasks. implemented blufi along with it for provisioning.
while switching from one task to another I call vTaskDelete(handler). To delete that task. But unfortunately i doubut memory is not released by that call. How can we free the memory?
memory releasing after task delete
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: memory releasing after task delete
The memory that is used by the stack and TCB of your task will get automatically released. If your task (or any function that it calls) does heap allocation (e.g. malloc, calloc, new, ...), that memory is not released; you need to release that yourself somehow. One option would be some sort of signal (e.g. a semaphore) that is sent to the task so it can clean up and delete itself.
Re: memory releasing after task delete
Thanks for the reply,
ESP_Sprite
"abort() was called at PC 0x40082f56 on core 0
0x40082f56: lock_acquire generic at C:/Users/Desktop/esp-idf/components newlib/locks.c:143
"
This is the error I am getting after the following flow. The program starts with wifi then shifts to BLE upon getting notifications:- deleting wifi task and de-initializing wifi. Then Shifts to BluFi upon user request then delete the BLE task and de-initializing the BLE task switch to BluFi. Upon completing the task the firmware crashes as above. Can you tell me what was causing this issue
ESP_Sprite
"abort() was called at PC 0x40082f56 on core 0
0x40082f56: lock_acquire generic at C:/Users/Desktop/esp-idf/components newlib/locks.c:143
"
This is the error I am getting after the following flow. The program starts with wifi then shifts to BLE upon getting notifications:- deleting wifi task and de-initializing wifi. Then Shifts to BluFi upon user request then delete the BLE task and de-initializing the BLE task switch to BluFi. Upon completing the task the firmware crashes as above. Can you tell me what was causing this issue
Re: memory releasing after task delete
If your task (or any function that it calls) does heap allocation (e.g. malloc, calloc, new, ...), that memory is not released; you need to release that yourself somehow.kubera wrote: ↑Sun Aug 23, 2020 4:01 amThanks for the reply,
ESP_Sprite
"abort() was called at PC 0x40082f56 on core 0
0x40082f56: lock_acquire generic at C:/Users/Desktop/esp-idf/components newlib/locks.c:143
"
This is the error I am getting after the following flow. The program starts with wifi then shifts to BLE upon getting notifications:- deleting wifi task and de-initializing wifi. Then Shifts to BluFi upon user request then delete the BLE task and de-initializing the BLE task switch to BluFi. Upon completing the task the firmware crashes as above. Can you tell me what was causing this issue
Who is online
Users browsing this forum: Assasinsareus and 104 guests