Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core3 reset GPIOs 16/17 when PSRAM is not used #20547

Merged
merged 2 commits into from Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions tasmota/tasmota.ino
Expand Up @@ -103,7 +103,9 @@
#include "include/tasmota_types.h"

#ifdef CONFIG_IDF_TARGET_ESP32
#include "driver/gpio.h"
#include "soc/efuse_reg.h"
#include "bootloader_common.h"
#endif

/*********************************************************************************************\
Expand Down Expand Up @@ -450,22 +452,26 @@ LinkedList<String> backlog; // Command backlog implemented with
void setup(void) {
#ifdef ESP32
#ifdef CONFIG_IDF_TARGET_ESP32

#ifdef DISABLE_ESP32_BROWNOUT
DisableBrownout(); // Workaround possible weak LDO resulting in brownout detection during Wifi connection
#endif // DISABLE_ESP32_BROWNOUT

// restore GPIO16/17 if no PSRAM is found
#if ESP_IDF_VERSION_MAJOR < 5 // TODO for esp-idf 5
if (!FoundPSRAM()) {
// test if the CPU is not pico
#if (ESP_IDF_VERSION_MAJOR >= 5)
uint32_t pkg_version = bootloader_common_get_chip_ver_pkg();
if (pkg_version <= 3) { // D0WD, S0WD, D2WD
#else // ESP_IDF_VERSION_MAJOR >= 5
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
#endif // ESP_IDF_VERSION_MAJOR >= 5
gpio_reset_pin(GPIO_NUM_16);
gpio_reset_pin(GPIO_NUM_17);
}
}
#endif
#endif // CONFIG_IDF_TARGET_ESP32
#endif // ESP32

Expand Down