#include <Arduino.h>
uint32_t chipId = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
for(int i=0; i<17; i=i+8) {
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
}
Serial.printf("ESP32 Chip model = %s Rev %d\n", ESP.getChipModel(), ESP.getChipRevision());
Serial.printf("This chip has %d cores\n", ESP.getChipCores());
Serial.print("Chip ID: "); Serial.println(chipId);
// 获取 Flash 大小(以字节为单位)
uint32_t flashSize = ESP.getFlashChipSize();
Serial.printf("Flash Size: %u bytes\n", flashSize);
// 获取 PSRAM 的大小(以字节为单位)
uint32_t psramSize = ESP.getPsramSize();
Serial.printf("PSRAM Size: %u bytes\n", psramSize);
// 获取剩余内存
uint32_t freeMemory = ESP.getFreeHeap();
Serial.printf("Free Memory: %u bytes\n", freeMemory);
// 获取总内存
uint32_t Totalheap = ESP.getHeapSize();
Serial.printf("Total heap: %u bytes\n", Totalheap);
// 获取 PSRAM 剩余内存
uint32_t FreePSRAM = ESP.getFreePsram();
Serial.printf("Free PSRAM: %u bytes\n", FreePSRAM);
delay(3000);
}
欢迎联系本站长QQ:3216572