mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
esp_system: fix the bug that some peripheral clocks are being disabled during cpu reset for esp32s2, c3, s3
This commit is contained in:
@@ -93,8 +93,8 @@ typedef enum {
|
|||||||
RTCWDT_CPU_RESET = 13, /**<13, RTC Watch dog Reset CPU*/
|
RTCWDT_CPU_RESET = 13, /**<13, RTC Watch dog Reset CPU*/
|
||||||
RTCWDT_BROWN_OUT_RESET = 15, /**<15, Reset when the vdd voltage is not stable*/
|
RTCWDT_BROWN_OUT_RESET = 15, /**<15, Reset when the vdd voltage is not stable*/
|
||||||
RTCWDT_RTC_RESET = 16, /**<16, RTC Watch dog reset digital core and rtc module*/
|
RTCWDT_RTC_RESET = 16, /**<16, RTC Watch dog reset digital core and rtc module*/
|
||||||
TG1WDT_CPU_RESET = 17, /**<11, Time Group1 reset CPU*/
|
TG1WDT_CPU_RESET = 17, /**<17, Time Group1 reset CPU*/
|
||||||
SUPER_WDT_RESET = 18, /**<11, super watchdog reset digital core and rtc module*/
|
SUPER_WDT_RESET = 18, /**<18, super watchdog reset digital core and rtc module*/
|
||||||
} RESET_REASON;
|
} RESET_REASON;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@@ -225,9 +225,9 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
/* For reason that only reset CPU, do not disable the clocks
|
/* For reason that only reset CPU, do not disable the clocks
|
||||||
* that have been enabled before reset.
|
* that have been enabled before reset.
|
||||||
*/
|
*/
|
||||||
if ((rst_reas[0] >= TGWDT_CPU_RESET && rst_reas[0] <= RTCWDT_CPU_RESET)
|
if ((rst_reas[0] == TGWDT_CPU_RESET || rst_reas[0] == SW_CPU_RESET || rst_reas[0] == RTCWDT_CPU_RESET)
|
||||||
#if !CONFIG_FREERTOS_UNICORE
|
#if !CONFIG_FREERTOS_UNICORE
|
||||||
|| (rst_reas[1] >= TGWDT_CPU_RESET && rst_reas[1] <= RTCWDT_CPU_RESET)
|
|| (rst_reas[1] == TGWDT_CPU_RESET || rst_reas[1] == SW_CPU_RESET || rst_reas[1] == RTCWDT_CPU_RESET)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
common_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN_REG);
|
common_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN_REG);
|
||||||
|
@@ -223,12 +223,11 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
/* For reason that only reset CPU, do not disable the clocks
|
/* For reason that only reset CPU, do not disable the clocks
|
||||||
* that have been enabled before reset.
|
* that have been enabled before reset.
|
||||||
*/
|
*/
|
||||||
/* For reason that only reset CPU, do not disable the clocks
|
if ((rst_reas[0] == TG0WDT_CPU_RESET || rst_reas[0] == RTC_SW_CPU_RESET ||
|
||||||
* that have been enabled before reset.
|
rst_reas[0] == RTCWDT_CPU_RESET || rst_reas[0] == TG1WDT_CPU_RESET)
|
||||||
*/
|
|
||||||
if ((rst_reas[0] >= TG0WDT_CPU_RESET && rst_reas[0] <= TG0WDT_CPU_RESET && rst_reas[0] != RTCWDT_BROWN_OUT_RESET)
|
|
||||||
#if !CONFIG_FREERTOS_UNICORE
|
#if !CONFIG_FREERTOS_UNICORE
|
||||||
|| (rst_reas[1] >= TG0WDT_CPU_RESET && rst_reas[1] <= RTCWDT_CPU_RESET)
|
|| (rst_reas[1] == TG0WDT_CPU_RESET || rst_reas[1] == RTC_SW_CPU_RESET ||
|
||||||
|
rst_reas[1] == RTCWDT_CPU_RESET || rst_reas[1] == TG1WDT_CPU_RESET)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
common_perip_clk = ~READ_PERI_REG(SYSTEM_PERIP_CLK_EN0_REG);
|
common_perip_clk = ~READ_PERI_REG(SYSTEM_PERIP_CLK_EN0_REG);
|
||||||
|
@@ -219,9 +219,10 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
/* For reason that only reset CPU, do not disable the clocks
|
/* For reason that only reset CPU, do not disable the clocks
|
||||||
* that have been enabled before reset.
|
* that have been enabled before reset.
|
||||||
*/
|
*/
|
||||||
if (rst_reas[0] >= TG0WDT_CPU_RESET &&
|
if (rst_reas[0] == TG0WDT_CPU_RESET ||
|
||||||
rst_reas[0] <= TG0WDT_CPU_RESET &&
|
rst_reas[0] == RTC_SW_CPU_RESET ||
|
||||||
rst_reas[0] != RTCWDT_BROWN_OUT_RESET) {
|
rst_reas[0] == RTCWDT_CPU_RESET ||
|
||||||
|
rst_reas[0] == TG1WDT_CPU_RESET) {
|
||||||
common_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN_REG);
|
common_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN_REG);
|
||||||
hwcrypto_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN1_REG);
|
hwcrypto_perip_clk = ~DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN1_REG);
|
||||||
wifi_bt_sdio_clk = ~DPORT_READ_PERI_REG(DPORT_WIFI_CLK_EN_REG);
|
wifi_bt_sdio_clk = ~DPORT_READ_PERI_REG(DPORT_WIFI_CLK_EN_REG);
|
||||||
|
@@ -221,9 +221,11 @@ __attribute__((weak)) void esp_perip_clk_init(void)
|
|||||||
/* For reason that only reset CPU, do not disable the clocks
|
/* For reason that only reset CPU, do not disable the clocks
|
||||||
* that have been enabled before reset.
|
* that have been enabled before reset.
|
||||||
*/
|
*/
|
||||||
if ((rst_reas[0] >= TG0WDT_CPU_RESET && rst_reas[0] <= TG0WDT_CPU_RESET && rst_reas[0] != RTCWDT_BROWN_OUT_RESET)
|
if ((rst_reas[0] == TG0WDT_CPU_RESET || rst_reas[0] == RTC_SW_CPU_RESET ||
|
||||||
|
rst_reas[0] == RTCWDT_CPU_RESET || rst_reas[0] == TG1WDT_CPU_RESET)
|
||||||
#if !CONFIG_FREERTOS_UNICORE
|
#if !CONFIG_FREERTOS_UNICORE
|
||||||
|| (rst_reas[1] >= TG0WDT_CPU_RESET && rst_reas[1] <= RTCWDT_CPU_RESET)
|
|| (rst_reas[1] == TG0WDT_CPU_RESET || rst_reas[1] == RTC_SW_CPU_RESET ||
|
||||||
|
rst_reas[1] == RTCWDT_CPU_RESET || rst_reas[1] == TG1WDT_CPU_RESET)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
common_perip_clk = ~READ_PERI_REG(SYSTEM_PERIP_CLK_EN0_REG);
|
common_perip_clk = ~READ_PERI_REG(SYSTEM_PERIP_CLK_EN0_REG);
|
||||||
|
Reference in New Issue
Block a user