如何在 ESP32 上使用 vPortGetHeapStats()?
问题:
编译 ESP32 项目时,你看到类似以下错误消息
compile_error_output.txt
src/main.cpp:128:3: error: 'vPortGetHeapStats' was not declared in this scope
vPortGetHeapStats(&heapStats);解决方案
虽然 vPortGetHeapStats() 通常在 freertos/portable.h 中定义,你不能在 ESP32 上使用 vPortGetHeapStats(),因为框架不使用 FreeRTOS 堆实现。
要查找有关堆使用的信息,使用 ESP heap API 如 esp_get_free_heap_size()。
Check out similar posts by category:
ESP8266/ESP32, FreeRTOS
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow