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
This commit is contained in:
@@ -263,9 +263,9 @@ 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);
|
||||||
|
@@ -229,9 +229,10 @@ 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);
|
||||||
|
Reference in New Issue
Block a user