How can I terminate FreeRTOS tasks and get the memory back?
Posted: Tue Mar 28, 2023 1:38 am
Hello,
I am running 2 tasks on my ESP32-S3
- Graphics Task
- Sensor Task
But when I start WIFI and add an Over-the-air update Task, the system runs out of memory.
I get strange errors like:
When I change my firmware and NOT run the sensor task, the OTA update works fine.
I tried deleting the sensor task before I start the OTA update with vTaskDelete( x_Sensor_Reader_Task_Handle );, but it doesn't help. (I also add vTaskDelay(pdMS_TO_TICKS(1000) to run the idle task and release memory).
Could you please give me some advice on how I could make enough memory available to run my update task?
Here are some more memory infos.
Total sizes:
Used static IRAM: 93282 bytes ( 268958 remain, 25.8% used)
.text size: 92255 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 38352 bytes ( 307504 remain, 11.1% used)
.data size: 18560 bytes
.bss size: 19792 bytes
Used Flash size : 1867417 bytes
.text : 868835 bytes
.rodata : 998326 bytes
Total image size: 1979259 bytes (.bin may be padded larger)
Smallest app partition is 0x200000 bytes. 0x1eb80 bytes (6%) free.
My partitions.csv:
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 2M
ota_0, app, ota_0, , 2M
ota_1, app, ota_1, , 2M
nvs_key, data, nvs_keys, , 0x1000
Thank you
I am running 2 tasks on my ESP32-S3
- Graphics Task
- Sensor Task
But when I start WIFI and add an Over-the-air update Task, the system runs out of memory.
I get strange errors like:
Code: Select all
I (13590) esp_https_ota: Starting OTA...
I (13590) esp_https_ota: Writing to partition subtype 16 at offset 0x210000
W (13650) wifi:m f null
E (60430) transport_base: poll_read select error 113, errno = Software caused connection abort, fd = 54
E (60430) HTTP_CLIENT: transport_read: error - 57347 | ERROR
E (60430) esp_https_ota: data read -1, errno 0
E (60440) ota.c: Firmware upgrade failed
I tried deleting the sensor task before I start the OTA update with vTaskDelete( x_Sensor_Reader_Task_Handle );, but it doesn't help. (I also add vTaskDelay(pdMS_TO_TICKS(1000) to run the idle task and release memory).
Could you please give me some advice on how I could make enough memory available to run my update task?
Here are some more memory infos.
Total sizes:
Used static IRAM: 93282 bytes ( 268958 remain, 25.8% used)
.text size: 92255 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 38352 bytes ( 307504 remain, 11.1% used)
.data size: 18560 bytes
.bss size: 19792 bytes
Used Flash size : 1867417 bytes
.text : 868835 bytes
.rodata : 998326 bytes
Total image size: 1979259 bytes (.bin may be padded larger)
Smallest app partition is 0x200000 bytes. 0x1eb80 bytes (6%) free.
My partitions.csv:
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 2M
ota_0, app, ota_0, , 2M
ota_1, app, ota_1, , 2M
nvs_key, data, nvs_keys, , 0x1000
Thank you