Advanced resource monitor for ESP32
๐ Tracks tasks, memory, PSRAM, heap, timers, and more, with detailed configuration options via Kconfig.
โ๏ธ Created by Baciu Aurel Florin (a.k.a. The Lightbringer)
- โ CPU usage per task (load, stack usage, core ID, priority)
- โ Advanced heap and PSRAM dump
- โ Segmented stats (DMA, RTCRAM, 8bit/32bit, etc.)
- โ Supports ESP timer dump
- โ
Optional: full memory heap dump (
heap_caps_dump()
) - โ Debug mode with timestamp and benchmarking
- โ Full Kconfig configuration
- โ
Runs using:
- Dedicated task (with notify)
- Directly from
esp_timer
(with or without task) - Pure FreeRTOS mode (
vTaskDelayUntil
)
- โ ESP-IDF v5.x+ compatible
ESP32S3_Resource_Monitor/
โโโ CMakeLists.txt
โโโ Kconfig
โโโ include/
โ โโโ ResourceMonitor.h
โโโ src/
โ โโโ ResourceMonitor.c
โโโ README.md
Component has a dedicated menu:
Component config --->
ESP32S3 Resource Monitor Configuration --->
[*] Enable Resource Monitor
[*] Use Kconfig for configuration
(4) Dump interval (seconds)
(40) Max number of monitored tasks
[*] Include timestamp in logs
[*] Enable task monitoring output
[*] Enable memory usage dump
[*] Use printf instead of ESP_LOGI for memory info
[ ] Enable full heap memory dump
[*] Enable ESP timer diagnostics
[*] Use ESP timer for triggering resource monitor
[ ] Run monitor directly inside ESP timer
In your CMakeLists.txt
:
set(EXTRA_COMPONENT_DIRS "<path>/ESP32S3_Resource_Monitor")
#include "ResourceMonitor.h"
void app_main() {
start_resource_monitor(); // Start the monitor
}
๐ Real console output:
I (652) MY-RESOURCE-MONITOR (BY Florin Baciu): ESPResourceMonitor v1.0.0 initialized
I (5647) MY-RESOURCE-MONITOR (BY Florin Baciu): Timestamp: [1970-01-01 02:38:50]
I (5647) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Task Dump Start-----------------
Load Stack State CoreID PRIO Name
0.01 1744 Running 1 3 [RESMONITOR(R) ]
98.56 2484 Ready 0 0 [IDLE0 ]
92.65 2492 Ready 1 0 [IDLE1 ]
0.21 2408 Blocked 1 24 [LVGL Tick Task ]
0.05 2196 Suspend 0 19 [ipc0 ]
0.01 1996 Suspend 1 19 [v_check_0_pin_s ]
0.08 6704 Suspend 1/2 3 [swdraw ]
0.57 6648 Suspend 1/2 3 [swdraw ]
0.00 3860 Suspend 0 22 [esp_timer ]
7.00 3616 Suspend 1 22 [LVGL Main Task ]
0.05 2332 Suspend 1 24 [ipc1 ]
I (5651) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Task Dump End-------------------
I (5651) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Memory Info Start---------------
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ MEMORY STATS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Segment โ Total โ Used โ Free โ Utilizare % โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโข
โ RAM โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RAM-DMA โ 266.5 KB โ 73.4 KB โ 193.1 KB โ 27.56 % โ
โ RAM 8 bit โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RAM 32 bit โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RTC RAM โ 7.7 KB โ 0.4 KB โ 7.3 KB โ 4.97 % โ
โ PSRAM โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โ PSRAM 8 bit โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โ PSRAM 32 bit โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I (5656) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Memory Info End-----------------
I (5656) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------ESP Timer Dump Start------------
Timer stats:
Name Period Alarm Times_armed Times_trigg Times_skip Cb_exec_time
res_mon_timer 5000000 10159844 1 1 0 10
I (5657) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------ESP Timer Dump End--------------
I (5658) RESMON_BENCH: resource_monitor_callback() execution time: 10648 ยตs (10.65 ms)
I (10647) RESMON_BENCH: ฮ timp รฎntre apeluri: 5000000 ยตs (5.00 sec)
I (10647) MY-RESOURCE-MONITOR (BY Florin Baciu): Timestamp: [1970-01-01 02:38:55]
Callback functions are modular:
task_monitor_cb()
memory_monitor_cb()
esp_timers_monitor_cb()
memory_dump_cb()
You can invoke them independently or integrate into custom diagnostics.
Apache 2.0 โ use freely, contribute confidently.
Pull requests, feedback, and enhancements are welcome!
Please follow the existing code style and provide comments.
๐ฎ Author: Baciu Aurel Florin
โ๏ธ Email: baciuaurelflorin@gmail.com
This isn't just a library. It's your eyes inside the system.
The heresy of idle tasks shall burn in the fire of RAM.
Monitor avansat de resurse pentru ESP32
๐ Monitorizeazฤ taskuri, memorie, PSRAM, heap, timere ศi mai mult, cu opศiuni detaliate de configurare via Kconfig.
โ๏ธ Creat de Baciu Aurel Florin (a.k.a. The Lightbringer)
- โ Monitorizare CPU per task (load, stack usage, core ID, prioritate)
- โ Dump avansat de heap ศi PSRAM
- โ Statistici segmentate (DMA, RTCRAM, 8bit/32bit, etc.)
- โ Suport pentru ESP timer dump
- โ
Opศional: memory heap dump complet (
heap_caps_dump()
) - โ Mod debug cu timestamp ศi benchmark
- โ Kconfig complet pentru configurare uศoarฤ
- โ
Suport pentru rulare รฎn:
- Task dedicat (cu notificare)
- Direct รฎn
esp_timer
(cu sau fฤrฤ task) - Mod FreeRTOS pur (
vTaskDelayUntil
)
- โ Compatibil ESP-IDF v5.x+
ESP32S3_Resource_Monitor/
โโโ CMakeLists.txt
โโโ Kconfig
โโโ include/
โ โโโ ResourceMonitor.h
โโโ src/
โ โโโ ResourceMonitor.c
โโโ README.md
Librฤria vine cu un meniu Kconfig dedicat:
Component config --->
ESP32S3 Resource Monitor Configuration --->
[*] Enable Resource Monitor
[*] Use Kconfig for configuration
(4) Dump interval (seconds)
(40) Max number of monitored tasks
[*] Include timestamp in logs
[*] Enable task monitoring output
[*] Enable memory usage dump
[*] Use printf instead of ESP_LOGI for memory info
[ ] Enable full heap memory dump
[*] Enable ESP timer diagnostics
[*] Use ESP timer for triggering resource monitor
[ ] Run monitor directly inside ESP timer
Adaugฤ รฎn CMakeLists.txt
:
set(EXTRA_COMPONENT_DIRS "<cale>/ESP32S3_Resource_Monitor")
#include "ResourceMonitor.h"
void app_main() {
start_resource_monitor(); // Porneศte monitorul
}
๐ Output Real:
I (652) MY-RESOURCE-MONITOR (BY Florin Baciu): ESPResourceMonitor v1.0.0 initialized
I (5647) MY-RESOURCE-MONITOR (BY Florin Baciu): Timestamp: [1970-01-01 02:38:50]
I (5647) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Task Dump Start-----------------
Load Stack State CoreID PRIO Name
0.01 1744 Running 1 3 [RESMONITOR(R) ]
98.56 2484 Ready 0 0 [IDLE0 ]
92.65 2492 Ready 1 0 [IDLE1 ]
0.21 2408 Blocked 1 24 [LVGL Tick Task ]
0.05 2196 Suspend 0 19 [ipc0 ]
0.01 1996 Suspend 1 19 [v_check_0_pin_s ]
0.08 6704 Suspend 1/2 3 [swdraw ]
0.57 6648 Suspend 1/2 3 [swdraw ]
0.00 3860 Suspend 0 22 [esp_timer ]
7.00 3616 Suspend 1 22 [LVGL Main Task ]
0.05 2332 Suspend 1 24 [ipc1 ]
I (5651) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Task Dump End-------------------
I (5651) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Memory Info Start---------------
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ MEMORY STATS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Segment โ Total โ Used โ Free โ Utilizare % โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโข
โ RAM โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RAM-DMA โ 266.5 KB โ 73.4 KB โ 193.1 KB โ 27.56 % โ
โ RAM 8 bit โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RAM 32 bit โ 274.2 KB โ 73.8 KB โ 200.4 KB โ 26.93 % โ
โ RTC RAM โ 7.7 KB โ 0.4 KB โ 7.3 KB โ 4.97 % โ
โ PSRAM โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โ PSRAM 8 bit โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โ PSRAM 32 bit โ 7104.0 KB โ 1363.1 KB โ 5740.9 KB โ 19.19 % โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
I (5656) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------Memory Info End-----------------
I (5656) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------ESP Timer Dump Start------------
Timer stats:
Name Period Alarm Times_armed Times_trigg Times_skip Cb_exec_time
res_mon_timer 5000000 10159844 1 1 0 10
I (5657) MY-RESOURCE-MONITOR (BY Florin Baciu): -----------------ESP Timer Dump End--------------
I (5658) RESMON_BENCH: resource_monitor_callback() execution time: 10648 ยตs (10.65 ms)
I (10647) RESMON_BENCH: ฮ timp รฎntre apeluri: 5000000 ยตs (5.00 sec)
I (10647) MY-RESOURCE-MONITOR (BY Florin Baciu): Timestamp: [1970-01-01 02:38:55]
Toate callback-urile de monitorizare sunt separate:
task_monitor_cb()
memory_monitor_cb()
esp_timers_monitor_cb()
memory_dump_cb()
Le poศi apela individual sau le poศi integra รฎntr-un sistem propriu de diagnostic.
Apache 2.0 โ foloseศte liber, contribuie cu รฎncredere.
Pull requests, idei ศi รฎmbunฤtฤศiri sunt binevenite!
Te rog adaugฤ comentarii clare ศi pฤstreazฤ stilul de cod existent.
๐ฎ Autor: Baciu Aurel Florin
โ๏ธ Email: baciuaurelflorin@gmail.com
Aceasta nu este doar o librฤrie. Este o extensie a ochilor tฤi รฎn sistem.
Eresul taskurilor inutile va fi ars รฎn focul RAM-ului.