ESP32-DevKitC V4 入门指南
esp32-devkitc开发板参数对比
在工程中使用函数查询可用堆大小等信息
esp_chip_info_t chip_info;esp_chip_info(&chip_info);printf("This is %s chip with %d CPU core(s), WiFi%s%s, ",CONFIG_IDF_TARGET,chip_info.cores,(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");printf("silicon revision %d, ", chip_info.revision);printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");printf("free heap size: %d bytes\n", esp_get_free_heap_size());printf("free internal heap size: %d bytes\n", esp_get_free_internal_heap_size());printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());
串口显示
在PowerShell使用指令esptool.py -p COM* flash_id
查询模组实际flash大小和芯片信息等数据
查询外部PSRAM信息
先选择支持外部RAM,打开menuconfig
菜单配置
再重新编译,烧录程序并打开串口数据
也可以在工程中调用相应函数查询
如图勾选
编写测试程序
static void monitor_task(void *pvParameters){static char InfoBuffer[512] = {0};while (1){vTaskList((char *) &InfoBuffer);printf("任务名 任务状态 优先级 剩余栈 任务序号\r\n");printf("\r\n%s\r\n", InfoBuffer);vTaskGetRunTimeStats((char *) &InfoBuffer);printf("\r\n任务名 运行计数 使用率\r\n");printf("\r\n%s\r\n", InfoBuffer);vTaskDelay(2000 / portTICK_PERIOD_MS);}}void app_main(void){xTaskCreate(monitor_task, "monitor_task", 4096, NULL, 6, NULL);while(1){}}
编译烧录并打开串口
注意,该方法要长时间监控才比较准确