From 2436a1c52c9900462aa2896ba8d27546d878234d Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 3 Sep 2022 16:55:30 +0200 Subject: [PATCH] Hardware Info in debug output Adds these to lines to the serial USB debug output (at startup): ```` CPU: ESP32-S3 rev. 0, 2 core(s), 240MHz. FLASH: 8MB, Mode 2 (DIO), speed 80MHz. PSRAM not used.```` --- platformio.ini | 4 ++++ wled00/wled.cpp | 28 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 966b1565..3fa1bb5b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -33,6 +33,7 @@ ; default_envs = esp8285_H801 ; default_envs = d1_mini_5CH_Shojo_PCB default_envs = esp32mdev +;default_envs = esp32s3-mdev ; default_envs = esp8266mdev ; default_envs = wemos_shield_esp32 ; default_envs = m5atom @@ -40,6 +41,7 @@ default_envs = esp32mdev ; default_envs = esp32dev_qio80 ; default_envs = esp32_eth_ota1mapp ; default_envs = esp32s2_saola +; default_envs = esp32c3dev src_dir = ./wled00 data_dir = ./wled00/data @@ -506,6 +508,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32s3} -D WLED_RELEASE_NAME=ESP32S3 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET + ; -D WLED_DEBUG -D USERMOD_AUDIOREACTIVE -D UM_AUDIOREACTIVE_USE_NEW_FFT -D USERMOD_CUSTOMEFFECTS @@ -527,6 +530,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET + ; -D WLED_DEBUG -D USERMOD_AUDIOREACTIVE -D UM_AUDIOREACTIVE_USE_NEW_FFT -D USERMOD_CUSTOMEFFECTS diff --git a/wled00/wled.cpp b/wled00/wled.cpp index c444cc7d..395d09e1 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -274,12 +274,32 @@ void WLED::setup() #ifdef ARDUINO_ARCH_ESP32 DEBUG_PRINT(F("esp32 ")); DEBUG_PRINTLN(ESP.getSdkVersion()); + + DEBUG_PRINT(F("CPU: ")); DEBUG_PRINT(ESP.getChipModel()); + DEBUG_PRINT(F(" rev. ")); DEBUG_PRINT(ESP.getChipRevision()); + DEBUG_PRINT(F(", ")); DEBUG_PRINT(ESP.getChipCores()); DEBUG_PRINT(F(" core(s)")); + DEBUG_PRINT(F(", ")); DEBUG_PRINT(ESP.getCpuFreqMHz()); DEBUG_PRINTLN(F("MHz.")); + DEBUG_PRINT(F("FLASH: ")); DEBUG_PRINT((ESP.getFlashChipSize()/1024)/1024); + DEBUG_PRINT(F("MB, Mode ")); DEBUG_PRINT(ESP.getFlashChipMode()); + #ifdef WLED_DEBUG + switch (ESP.getFlashChipMode()) { + // missing: Octal modes + case FM_QIO: DEBUG_PRINT(F(" (QIO)")); break; + case FM_QOUT: DEBUG_PRINT(F(" (QOUT)"));break; + case FM_DIO: DEBUG_PRINT(F(" (DIO)")); break; + case FM_DOUT: DEBUG_PRINT(F(" (DOUT)"));break; + default: break; + } + #endif + DEBUG_PRINT(F(", speed ")); DEBUG_PRINT(ESP.getFlashChipSpeed()/1000000);DEBUG_PRINTLN(F("MHz.")); + #else DEBUG_PRINT(F("esp8266 ")); DEBUG_PRINTLN(ESP.getCoreVersion()); #endif DEBUG_PRINT(F("heap ")); DEBUG_PRINTLN(ESP.getFreeHeap()); + DEBUG_PRINTLN(); #if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM) if (psramFound()) { @@ -288,7 +308,13 @@ void WLED::setup() managed_pin_type pins[2] = { {16, true}, {17, true} }; pinManager.allocateMultiplePins(pins, 2, PinOwner::SPI_RAM); #endif - } + DEBUG_PRINT(F("Total PSRAM: ")); DEBUG_PRINT(ESP.getPsramSize()/1024); DEBUG_PRINTLN("kB"); + DEBUG_PRINT(F("Free PSRAM : ")); DEBUG_PRINT(ESP.getFreePsram()/1024); DEBUG_PRINTLN("kB"); + } else + DEBUG_PRINTLN(F("No PSRAM found.")); + #endif + #if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && !defined(WLED_USE_PSRAM) + DEBUG_PRINTLN(F("PSRAM not used.")); #endif //DEBUG_PRINT(F("LEDs inited. heap usage ~"));