From c6420792f2aad638ee0e165cdceb93400b4960e2 Mon Sep 17 00:00:00 2001 From: XiaXiaotian Date: Mon, 27 Feb 2017 16:48:04 +0800 Subject: [PATCH 1/2] 1. Do not disable clock for generating random number. 2. And fix the bug that system crashes if call esp_wifi_stop() twice. --- components/esp32/lib | 2 +- components/esp32/phy_init.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp32/lib b/components/esp32/lib index 28c6ee924..965f7400f 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 28c6ee924ca6efc71bb77dcb040efd07d4d8a000 +Subproject commit 965f7400f339dc1e4566cea232602e225b1e4085 diff --git a/components/esp32/phy_init.c b/components/esp32/phy_init.c index 34e1a9f00..f70aa4a50 100644 --- a/components/esp32/phy_init.c +++ b/components/esp32/phy_init.c @@ -84,8 +84,8 @@ esp_err_t esp_phy_rf_deinit(void) if (s_phy_rf_init_count == 1) { // Disable PHY and RF. TODO: convert this function to another one. pm_close_rf(); - // Disable WiFi peripheral clock - CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x87cf); + // Disable WiFi peripheral clock. Do not disable clock for generating random number. + CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x874f); } else { #if CONFIG_SW_COEXIST_ENABLE coex_deinit(); From f36c909528469f601d41ae23308f26562f12d350 Mon Sep 17 00:00:00 2001 From: XiaXiaotian Date: Mon, 27 Feb 2017 19:54:22 +0800 Subject: [PATCH 2/2] update phy and rtc lib 1. RTC V214: modify APLL function for the chip of ECO version. 2. Add API phy_close_rf() and use it in esp_phy_deinit() instead of pm_close_rf(). 3. RTC V213: fix BT will not work when BT-init is called more than once. --- components/esp32/lib | 2 +- components/esp32/phy_init.c | 4 ++-- components/esp32/rtc.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp32/lib b/components/esp32/lib index 965f7400f..7b06303c0 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 965f7400f339dc1e4566cea232602e225b1e4085 +Subproject commit 7b06303c0fa416aea7f86b7596e84db367189066 diff --git a/components/esp32/phy_init.c b/components/esp32/phy_init.c index f70aa4a50..ccb53fe35 100644 --- a/components/esp32/phy_init.c +++ b/components/esp32/phy_init.c @@ -82,8 +82,8 @@ esp_err_t esp_phy_rf_deinit(void) _lock_acquire(&s_phy_rf_init_lock); if (s_phy_rf_init_count == 1) { - // Disable PHY and RF. TODO: convert this function to another one. - pm_close_rf(); + // Disable PHY and RF. + phy_close_rf(); // Disable WiFi peripheral clock. Do not disable clock for generating random number. CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x874f); } else { diff --git a/components/esp32/rtc.h b/components/esp32/rtc.h index f21d0da83..e1262a1ca 100644 --- a/components/esp32/rtc.h +++ b/components/esp32/rtc.h @@ -138,7 +138,7 @@ uint32_t rtc_sleep(uint32_t cycles_h, uint32_t cycles_l, uint32_t wakeup_opt, ui /** * @brief Shutdown PHY and RF. TODO: convert this function to another one. */ -void pm_close_rf(void); +void phy_close_rf(void); #ifdef __cplusplus }