Hello,
ST has the same and I like it so I fixed it on eclipse for ESP
(Only tested for ESP32-S2 and mostly interested in cpu usage)
VSCode is awesome for developing but its awful for debugging in my opinion...
- espressif-ide_6TcTsTiRMn.png (31.74 KiB) Viewed 7295 times
1. Install FreeRTOS Task Aware Debugger from
http://freescale.com/lgfiles/updates/Eclipse/KDS like this guide
https://mcuoneclipse.com/2017/03/18/bet ... n-eclipse/
2. tick in sdkconfig: Component Config -> FreeRTOS -> Enable FreeRTOS to collect runtime stats
3. Go to esp_idf_components/freertos/tasks.c
Find: PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL;
(It's at line 430 now)
a) You can either add "volatile" in front of it:
Code: Select all
volatile PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL;
b) Disable GCC optimization for this variable:
Code: Select all
#pragma GCC push_options
#pragma GCC optimize ("O0")
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL;
#pragma GCC pop_options
Future prof notice: If something doesn't work you can open the nxp jar located in \tools\espressif-ide\2.6.0\plugins with "jd gui" and view what variables tries to read. If something is "optimized out" while debugging you have to make it volatile so the plugin can read its value. I don't think that ESP team changed FreeRTOS variable names so it will be just the optimization if something doesn't work.