diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 7a89ea689..351fbed7c 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -78,6 +78,10 @@ // Structs #include "settings.h" +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "soc/efuse_reg.h" +#endif + /*********************************************************************************************\ * Global variables \*********************************************************************************************/ @@ -222,6 +226,18 @@ void setup(void) { #endif #endif +#ifdef CONFIG_IDF_TARGET_ESP32 + // restore GPIO16/17 if no PSRAM is found + if (!FoundPSRAM()) { + // test if the CPU is not pico + uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG); + uint32_t pkg_version = chip_ver & 0x7; + if (pkg_version <= 3) { // D0WD, S0WD, D2WD + gpio_reset_pin(GPIO_NUM_16); + gpio_reset_pin(GPIO_NUM_17); + } + } +#endif RtcPreInit(); SettingsInit();