Skip to content

Commit a24dc94

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'fix/fix_modem_module_clock_missing_after_ota_v5.3' into 'release/v5.3'
fix(esp_system): deselect all modem modules lp clock source selection before clk initialization (v5.3) See merge request espressif/esp-idf!34924
2 parents 4143156 + 00cd226 commit a24dc94

File tree

7 files changed

+26
-5
lines changed

7 files changed

+26
-5
lines changed

components/esp_hw_support/include/esp_private/esp_modem_clock.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -107,9 +107,15 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl
107107

108108
/**
109109
* @brief Disable lowpower clock source selection
110+
* @param module modem module
110111
*/
111112
void modem_clock_deselect_lp_clock_source(periph_module_t module);
112113

114+
/**
115+
* @brief Disable all modem module's lowpower clock source selection
116+
*/
117+
void modem_clock_deselect_all_module_lp_clock_source(void);
118+
113119
/**
114120
* @brief Reset wifi mac
115121
*/

components/esp_hw_support/modem_clock.c

+11
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ void IRAM_ATTR modem_clock_module_disable(periph_module_t module)
346346
modem_clock_device_disable(MODEM_CLOCK_instance(), deps);
347347
}
348348

349+
void modem_clock_deselect_all_module_lp_clock_source(void)
350+
{
351+
#if SOC_WIFI_SUPPORTED
352+
modem_clock_hal_deselect_all_wifi_lpclk_source(MODEM_CLOCK_instance()->hal);
353+
#endif
354+
#if SOC_BT_SUPPORTED
355+
modem_clock_hal_deselect_all_ble_rtc_timer_lpclk_source(MODEM_CLOCK_instance()->hal);
356+
#endif
357+
modem_clock_hal_deselect_all_coex_lpclk_source(MODEM_CLOCK_instance()->hal);
358+
}
359+
349360
void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider)
350361
{
351362
assert(IS_MODEM_MODULE(module));

components/esp_system/port/soc/esp32c5/clk.c

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ __attribute__((weak)) void esp_clk_init(void)
8383
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
8484
#endif
8585

86+
modem_clock_deselect_all_module_lp_clock_source();
8687
#if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS)
8788
select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K);
8889
#elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC)

components/esp_system/port/soc/esp32c6/clk.c

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ __attribute__((weak)) void esp_clk_init(void)
102102
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
103103
#endif
104104

105+
modem_clock_deselect_all_module_lp_clock_source();
105106
#if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS)
106107
select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K);
107108
#elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC)

components/esp_system/port/soc/esp32c61/clk.c

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ __attribute__((weak)) void esp_clk_init(void)
7575
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
7676
#endif
7777

78+
modem_clock_deselect_all_module_lp_clock_source();
7879
#if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS)
7980
select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K);
8081
#elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC)

components/esp_system/port/soc/esp32h2/clk.c

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "hal/temperature_sensor_ll.h"
4444
#include "hal/usb_serial_jtag_ll.h"
4545
#include "esp_private/periph_ctrl.h"
46+
#include "esp_private/esp_modem_clock.h"
4647
#include "esp_private/esp_clk.h"
4748
#include "esp_private/esp_pmu.h"
4849
#include "esp_rom_uart.h"
@@ -101,6 +102,7 @@ __attribute__((weak)) void esp_clk_init(void)
101102
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
102103
#endif
103104

105+
modem_clock_deselect_all_module_lp_clock_source();
104106
#if defined(CONFIG_RTC_CLK_SRC_EXT_CRYS)
105107
select_rtc_slow_clk(SOC_RTC_SLOW_CLK_SRC_XTAL32K);
106108
#elif defined(CONFIG_RTC_CLK_SRC_EXT_OSC)

examples/wifi/power_save/pytest_wifi_power_save.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
1+
# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
22
# SPDX-License-Identifier: Apache-2.0
3-
43
import logging
54

65
import pexpect
@@ -9,7 +8,7 @@
98
from pytest_embedded import Dut
109

1110
bad_event_str = [
12-
'bcn_timout',
11+
'bcn_timeout',
1312
'm f probe req l',
1413
'abort() was called',
1514
'Guru Meditation Error',
@@ -31,7 +30,7 @@ def _run_test(dut: Dut) -> None:
3130
pass
3231

3332
try:
34-
dut.expect(r'got ip: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=20)
33+
dut.expect(r'got ip: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=30)
3534
log_after_got_ip = dut.expect(pexpect.TIMEOUT, timeout=10).decode()
3635
if any(s in log_after_got_ip for s in bad_event_str):
3736
logging.info('Abnormal connection log:')

0 commit comments

Comments
 (0)