當前位置:網站首頁>合宙ESP32C3硬件配置信息串口打印輸出

合宙ESP32C3硬件配置信息串口打印輸出

2022-07-23 21:12:32perseverance52

合宙ESP32C3硬件配置信息串口打印輸出


ESP32C3硬件簡介

ESP32-C3 搭載 RISC-V 32 比特單核處理器,時鐘頻率高達 160 MHz。具有 22 個可編程 GPIO 管脚、內置 400 KB SRAM,集成 2.4 GHz Wi-Fi 和支持長距離的 Bluetooth 5 (LE),支持藍牙 Mesh (Bluetooth Mesh) 協議和樂鑫 Wi-Fi Mesh.

示例程序

/* Blink This example code is in the public domain. https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink */



void setup() {
    
  Serial.begin(115200);
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
    

  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(13, LOW);   // turn the LED on (HIGH is the voltage level)
  delay(1000); // wait for a second

  digitalWrite(12, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(13, HIGH);
  delay(1000);  

Serial.printf("getHeapSize= %d \n",ESP.getHeapSize());
delay(10);
Serial.printf("getFreeHeap= %d \n",ESP.getFreeHeap());
 delay(10);
 Serial.printf("getChipRevision= %d \n",ESP.getChipRevision()); // 3
 delay(10);
 Serial.printf("getChipRevision= %s \n",ESP.getChipModel()); //ESP32-C3
 delay(10);
 Serial.printf("getChipCores= %d Core\n",ESP.getChipCores()); // 1
 delay(10);
 Serial.printf("getCpuFreqMHz= %d MHz\n",ESP.getCpuFreqMHz()); //160 
delay(10);
// Serial.printf("getSdkVersion= %s \n",ESP.getSdkVersion()); 
// Serial.printf("getFlashChipSize= %s \n",ESP.getFlashChipSize());
// Serial.printf("getFlashChipSpeed= %s \n",ESP.getFlashChipSpeed());
Serial.printf("getSketchSize= %d bytes\n",ESP.getSketchSize()); //250128
 delay(10);
 Serial.printf("getFreeSketchSpace= %d bytes\n",ESP.getFreeSketchSpace()); //13631488 bytes
 delay(10);
 Serial.printf("getSketchMD5= %s \n",ESP.getSketchMD5().c_str());//acaaaa867e2263c1f83c0daef8474855
 delay(10);
 uint32_t flash_Size = ESP.getFlashChipSize(); 
 Serial.printf("getFlashChipSize= %d \n",flash_Size); //16777216
delay(10);
 Serial.printf("getFlashChipSpeed= %d \n",ESP.getFlashChipSpeed()); //80000000
 delay(10);
 FlashMode_t flash_Mode = ESP.getFlashChipMode();
 Serial.printf("Flash mode: %s\n", (flash_Mode == FM_QIO ? "QIO" : flash_Mode == FM_QOUT ? "QOUT" : flash_Mode == FM_DIO ? "DIO" : flash_Mode == FM_DOUT ? "DOUT" : "UNKNOWN"));
 delay(1000);

}
  • 基於VSCode PIO編譯相同的代碼

程序代碼編譯只占1.7%符合自定義分區錶的配置。但是在VSCode PIO編譯上傳的代碼有一個問題,就是通過函數無法讀取外置SPI flash 容量。

在這裏插入圖片描述
在這裏插入圖片描述

  • 基於Arduino IDE編譯的串口打印信息
    在這裏插入圖片描述
    • 基於VSCode PIO編譯上傳的代碼,然後串口打印信息

在這裏插入圖片描述

版權聲明
本文為[perseverance52]所創,轉載請帶上原文鏈接,感謝
https://cht.chowdera.com/2022/204/202207232112041585.html

隨機推薦