FreeRtos cpu starvation issue
Posted: Mon Dec 08, 2025 1:34 pm
Hello ,
In below main.c file i am running task ,task1 from to ...... task21 and in this task wifi_rssi_monitor_task try to download 29kb data using call api and http ,
case 1:
if total number of task is 15 used than i can download proper data every time
case 2:
if i increase number of task 16 to 21 or more i an unable to download proper data
i change in menuconfig file which is mention in below screenshoot
my code output :
================= SYSTEM MONITOR =================
Free heap: 139224 bytes
Minimum ever free heap: 132288 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 139224 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (20384) wifi:<ba-add>idx:1 (ifx:0, 40:86:cb
ce:1f), tid:5, ssn:0, winSize:64
I (20404) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (20404) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
================= SYSTEM MONITOR =================
Free heap: 89920 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 89920 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (23394) WiFi_Scanner: ���� Guest RSSI: -52 dBm
I (23394) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (26314) WiFi_Scanner: ���� Guest RSSI: -51 dBm
I (26314) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 93992 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 94172 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (29234) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (29234) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (29694) mqtts_example: MQTT_EVENT_CONNECTED
I (29694) mqtts_example: Subscribed to topic 'test/client', msg_id=35146
main_field=*****************1I (30104) mqtts_example: Published JSON to 'ble-MAC': {
"type": "aaaaaa",
"Tag": "1"
} | msg_id=25057
I (32154) WiFi_Scanner: ���� Guest RSSI: -50 dBm
I (32154) WiFi_Scanner: ���� Still connected to Guest (RSSI: -50 dBm)
I (32554) mqtts_example: Other event id:3
================= SYSTEM MONITOR =================
Free heap: 94572 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 94572 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (35074) WiFi_Scanner: ���� Guest RSSI: -62 dBm
I (35074) WiFi_Scanner: ���� Still connected to Guest (RSSI: -62 dBm)
I (35104) mqtts_example: Other event id:5
I (37994) WiFi_Scanner: ���� Guest RSSI: -62 dBm
I (37994) WiFi_Scanner: ���� Still connected to Guest (RSSI: -62 dBm)
================= SYSTEM MONITOR =================
Free heap: 96876 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96876 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (40914) WiFi_Scanner: ���� Guest RSSI: -59 dBm
I (40914) WiFi_Scanner: ���� Still connected to Guest (RSSI: -59 dBm)
I (43834) WiFi_Scanner: ���� Guest RSSI: -55 dBm
I (43834) WiFi_Scanner: ���� Still connected to Guest (RSSI: -55 dBm)
================= SYSTEM MONITOR =================
Free heap: 97276 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 97276 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (46754) WiFi_Scanner: ���� Guest RSSI: -54 dBm
I (46754) WiFi_Scanner: ���� Still connected to Guest (RSSI: -54 dBm)
================= SYSTEM MONITOR =================
Free heap: 96376 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96376 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (49674) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (49674) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (52604) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (52604) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
================= SYSTEM MONITOR =================
Free heap: 96776 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96776 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (55524) WiFi_Scanner: ���� Guest RSSI: -59 dBm
I (55524) WiFi_Scanner: ���� Still connected to Guest (RSSI: -59 dBm)
I (55524) mqtts_example: MQTT_EVENT_DATA
TOPIC=DT:10:20:BA:08:12:7E
DATA="hello"
TOPIC=DT:10:20:BA:08:12:7E
DATA="hello"
I (58444) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (58444) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
I (59084) ASSISTNOW: [] Attempt 1/1
I (59084) ASSISTNOW: POST ""
W (59084) mqtts_example: Failed to parse JSON data: "hello"
================= SYSTEM MONITOR =================
Free heap: 82748 bytes
Minimum ever free heap: 82552 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 82748 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (61364) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (61364) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (61454) esp-x509-crt-bundle: Certificate validated
I (64294) WiFi_Scanner: ���� Guest RSSI: -54 dBm
I (64294) WiFi_Scanner: ���� Still connected to Guest (RSSI: -54 dBm)
================= SYSTEM MONITOR =================
Free heap: 44904 bytes
Minimum ever free heap: 39944 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 44904 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (67214) WiFi_Scanner: ���� Guest RSSI: -52 dBm
I (67214) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (70134) WiFi_Scanner: ���� Guest RSSI: -51 dBm
I (70134) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 19112 bytes
Minimum ever free heap: 8748 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 19112 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (73054) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (73054) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (73334) ASSISTNOW: HTTP 200, content-length: 29440, captured=29440, finished=yes
I (73334) POST API: POST completed
I (74454) ASSISTNOW: [] Done. Deleting task.
================= SYSTEM MONITOR =================
Free heap: 60968 bytes
Minimum ever free heap: 3636 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 60968 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (75954) mqtts_example: Other event id:5
I (75974) WiFi_Scanner: ���� Guest RSSI: -53 dBm
I (75974) WiFi_Scanner: ���� Still connected to Guest (RSSI: -53 dBm)
case 1 output:
I (41064) WiFi_Scanner: ���� RSSI: -51 dBm
I (41064) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
I (43984) WiFi_Scanner: ���� RSSI: -52 dBm
I (43984) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
================= SYSTEM MONITOR =================
Free heap: 52592 bytes
Minimum ever free heap: 39720 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 52592 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (46914) WiFi_Scanner: ���� RSSI: -52 dBm
I (46914) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (49834) WiFi_Scanner: ���� RSSI: -52 dBm
I (49834) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (49864) ASSISTNOW: HTTP 200, content-length: 29440, captured=29440, finished=yes
case 2 output :
I (116994) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 26784 bytes
Minimum ever free heap: 18328 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 26784 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (119904) ASSISTNOW: HTTP 200, content-length: 29440, captured=16128, finished=yes
W (119904) ASSISTNOW: Short read: expected=29440, got=16128
I (119924) WiFi_Scanner: ���� RSSI: -48 dBm
I (119944) POST API: POST completed
I (120024) WiFi_Scanner: ���� Still connected to Guest (RSSI: -48 dBm)
I (120094) mqtts_example: Other event id:5
I (121164) ASSISTNOW: [k] Done. Deleting task.
I (123064) WiFi_Scanner: ���� RSSI: -50 dBm
I (123064) WiFi_Scanner: ���� Still connected to Guest (RSSI: -50 dBm)
================= SYSTEM MONITOR =================
Free heap: 75448 bytes
Minimum ever free heap: 14920 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 75448 bytes
Free PSRAM: 0 bytes
can you guide me how to solve this issue so i can download data properly , i hope we will connect as soon as possible
thank you
In below main.c file i am running task ,task1 from to ...... task21 and in this task wifi_rssi_monitor_task try to download 29kb data using call api and http ,
case 1:
if total number of task is 15 used than i can download proper data every time
case 2:
if i increase number of task 16 to 21 or more i an unable to download proper data
i change in menuconfig file which is mention in below screenshoot
my code output :
================= SYSTEM MONITOR =================
Free heap: 139224 bytes
Minimum ever free heap: 132288 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 139224 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (20384) wifi:<ba-add>idx:1 (ifx:0, 40:86:cb
I (20404) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (20404) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
================= SYSTEM MONITOR =================
Free heap: 89920 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 89920 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (23394) WiFi_Scanner: ���� Guest RSSI: -52 dBm
I (23394) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (26314) WiFi_Scanner: ���� Guest RSSI: -51 dBm
I (26314) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 93992 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 94172 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (29234) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (29234) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (29694) mqtts_example: MQTT_EVENT_CONNECTED
I (29694) mqtts_example: Subscribed to topic 'test/client', msg_id=35146
main_field=*****************1I (30104) mqtts_example: Published JSON to 'ble-MAC': {
"type": "aaaaaa",
"Tag": "1"
} | msg_id=25057
I (32154) WiFi_Scanner: ���� Guest RSSI: -50 dBm
I (32154) WiFi_Scanner: ���� Still connected to Guest (RSSI: -50 dBm)
I (32554) mqtts_example: Other event id:3
================= SYSTEM MONITOR =================
Free heap: 94572 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 94572 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (35074) WiFi_Scanner: ���� Guest RSSI: -62 dBm
I (35074) WiFi_Scanner: ���� Still connected to Guest (RSSI: -62 dBm)
I (35104) mqtts_example: Other event id:5
I (37994) WiFi_Scanner: ���� Guest RSSI: -62 dBm
I (37994) WiFi_Scanner: ���� Still connected to Guest (RSSI: -62 dBm)
================= SYSTEM MONITOR =================
Free heap: 96876 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96876 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (40914) WiFi_Scanner: ���� Guest RSSI: -59 dBm
I (40914) WiFi_Scanner: ���� Still connected to Guest (RSSI: -59 dBm)
I (43834) WiFi_Scanner: ���� Guest RSSI: -55 dBm
I (43834) WiFi_Scanner: ���� Still connected to Guest (RSSI: -55 dBm)
================= SYSTEM MONITOR =================
Free heap: 97276 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 97276 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (46754) WiFi_Scanner: ���� Guest RSSI: -54 dBm
I (46754) WiFi_Scanner: ���� Still connected to Guest (RSSI: -54 dBm)
================= SYSTEM MONITOR =================
Free heap: 96376 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96376 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (49674) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (49674) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (52604) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (52604) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
================= SYSTEM MONITOR =================
Free heap: 96776 bytes
Minimum ever free heap: 85532 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 96776 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (55524) WiFi_Scanner: ���� Guest RSSI: -59 dBm
I (55524) WiFi_Scanner: ���� Still connected to Guest (RSSI: -59 dBm)
I (55524) mqtts_example: MQTT_EVENT_DATA
TOPIC=DT:10:20:BA:08:12:7E
DATA="hello"
TOPIC=DT:10:20:BA:08:12:7E
DATA="hello"
I (58444) WiFi_Scanner: ���� Guest RSSI: -57 dBm
I (58444) WiFi_Scanner: ���� Still connected to Guest (RSSI: -57 dBm)
I (59084) ASSISTNOW: [] Attempt 1/1
I (59084) ASSISTNOW: POST ""
W (59084) mqtts_example: Failed to parse JSON data: "hello"
================= SYSTEM MONITOR =================
Free heap: 82748 bytes
Minimum ever free heap: 82552 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 82748 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (61364) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (61364) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (61454) esp-x509-crt-bundle: Certificate validated
I (64294) WiFi_Scanner: ���� Guest RSSI: -54 dBm
I (64294) WiFi_Scanner: ���� Still connected to Guest (RSSI: -54 dBm)
================= SYSTEM MONITOR =================
Free heap: 44904 bytes
Minimum ever free heap: 39944 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 44904 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (67214) WiFi_Scanner: ���� Guest RSSI: -52 dBm
I (67214) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (70134) WiFi_Scanner: ���� Guest RSSI: -51 dBm
I (70134) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 19112 bytes
Minimum ever free heap: 8748 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 19112 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (73054) WiFi_Scanner: ���� Guest RSSI: -56 dBm
I (73054) WiFi_Scanner: ���� Still connected to Guest (RSSI: -56 dBm)
I (73334) ASSISTNOW: HTTP 200, content-length: 29440, captured=29440, finished=yes
I (73334) POST API: POST completed
I (74454) ASSISTNOW: [] Done. Deleting task.
================= SYSTEM MONITOR =================
Free heap: 60968 bytes
Minimum ever free heap: 3636 bytes
Total heap (8-bit capable): 331940 bytes
Free internal heap: 60968 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (75954) mqtts_example: Other event id:5
I (75974) WiFi_Scanner: ���� Guest RSSI: -53 dBm
I (75974) WiFi_Scanner: ���� Still connected to Guest (RSSI: -53 dBm)
case 1 output:
I (41064) WiFi_Scanner: ���� RSSI: -51 dBm
I (41064) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
I (43984) WiFi_Scanner: ���� RSSI: -52 dBm
I (43984) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
================= SYSTEM MONITOR =================
Free heap: 52592 bytes
Minimum ever free heap: 39720 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 52592 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (46914) WiFi_Scanner: ���� RSSI: -52 dBm
I (46914) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (49834) WiFi_Scanner: ���� RSSI: -52 dBm
I (49834) WiFi_Scanner: ���� Still connected to Guest (RSSI: -52 dBm)
I (49864) ASSISTNOW: HTTP 200, content-length: 29440, captured=29440, finished=yes
case 2 output :
I (116994) WiFi_Scanner: ���� Still connected to Guest (RSSI: -51 dBm)
================= SYSTEM MONITOR =================
Free heap: 26784 bytes
Minimum ever free heap: 18328 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 26784 bytes
Free PSRAM: 0 bytes
----- Task List (stack free bytes) -----
----- Runtime Stats -----
==================================================
I (119904) ASSISTNOW: HTTP 200, content-length: 29440, captured=16128, finished=yes
W (119904) ASSISTNOW: Short read: expected=29440, got=16128
I (119924) WiFi_Scanner: ���� RSSI: -48 dBm
I (119944) POST API: POST completed
I (120024) WiFi_Scanner: ���� Still connected to Guest (RSSI: -48 dBm)
I (120094) mqtts_example: Other event id:5
I (121164) ASSISTNOW: [k] Done. Deleting task.
I (123064) WiFi_Scanner: ���� RSSI: -50 dBm
I (123064) WiFi_Scanner: ���� Still connected to Guest (RSSI: -50 dBm)
================= SYSTEM MONITOR =================
Free heap: 75448 bytes
Minimum ever free heap: 14920 bytes
Total heap (8-bit capable): 332436 bytes
Free internal heap: 75448 bytes
Free PSRAM: 0 bytes
can you guide me how to solve this issue so i can download data properly , i hope we will connect as soon as possible
thank you