From 2325ad7ac18c599d7bacfa267ab3ed6b439ae827 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Thu, 26 Jun 2025 16:40:13 +0800 Subject: [PATCH 1/2] fix(wifi): update ld files of esp32c5 --- .../esp_rom/esp32c5/ld/esp32c5.rom.pp.ld | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld b/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld index 645b85c724..0b4f03932a 100644 --- a/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld +++ b/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld @@ -133,7 +133,7 @@ pm_rx_beacon_process = 0x40000dac; pm_rx_data_process = 0x40000db0; pm_sleep = 0x40000db4; pm_sleep_for = 0x40000db8; -pm_tbtt_process = 0x40000dbc; +//pm_tbtt_process = 0x40000dbc; pm_tx_data_done_process = 0x40000dc0; pm_allow_tx = 0x40000dc4; pm_extend_tbtt_adaptive_servo = 0x40000dc8; @@ -151,9 +151,9 @@ pm_twt_set_target_tsf = 0x40000df4; pm_enable_twt_keep_alive_timer = 0x40000df8; /*pm_mac_try_enable_modem_state = 0x40000dfc;*/ pm_beacon_monitor_tbtt_timeout_process = 0x40000e00; -pm_update_next_tbtt = 0x40000e04; +//pm_update_next_tbtt = 0x40000e04; pm_twt_disallow_tx = 0x40000e08; -pm_clear_wakeup_signal = 0x40000e0c; +//pm_clear_wakeup_signal = 0x40000e0c; //pm_mac_disable_tsf_tbtt_soc_wakeup = 0x40000e10; //pm_mac_disable_tsf_tbtt_modem_wakeup = 0x40000e14; //pm_mac_enable_tsf_tbtt_soc_wakeup = 0x40000e18; @@ -462,9 +462,9 @@ pm_coex_schm_overall_period_get = 0x40001504; //pm_coex_pwr_update = 0x40001508; ppRemoveHEAMPDUflags = 0x4000150c; tsf_hal_get_tbtt_interval = 0x40001510; -pm_beacon_monitor_tbtt_start = 0x40001514; +//pm_beacon_monitor_tbtt_start = 0x40001514; pm_save_tbtt_info = 0x40001518; -pm_get_tbtt_count = 0x4000151c; +//pm_get_tbtt_count = 0x4000151c; tsf_hal_get_time = 0x40001520; tsf_hal_get_counter_value = 0x40001524; @@ -488,10 +488,10 @@ pm_beacon_offset_is_enabled = 0x400015bc; pm_beacon_offset_is_sampling = 0x400015c0; pm_beacon_offset_add_total_counter = 0x400015c4; pm_beacon_offset_add_loss_counter = 0x400015c8; -pm_beacon_offset_check = 0x400015cc; -pm_beacon_offset_get_average = 0x400015d0; -pm_beacon_offset_get_expect = 0x400015d4; -pm_beacon_offset_get_params = 0x400015d8; +//pm_beacon_offset_check = 0x400015cc; +//pm_beacon_offset_get_average = 0x400015d0; +//pm_beacon_offset_get_expect = 0x400015d4; +//pm_beacon_offset_get_params = 0x400015d8; /* Data (.data, .bss, .rodata) */ s_tbttstart_ptr = 0x4085fc68; s_pm_beacon_offset_ptr = 0x4085fc64; From 9ec9b051634feab68c685b6e71210498b500ca90 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Fri, 27 Jun 2025 15:15:22 +0800 Subject: [PATCH 2/2] fix(twt): fix some issus related itwt --- components/esp_wifi/lib | 2 +- examples/wifi/itwt/main/Kconfig.projbuild | 9 +++++++-- examples/wifi/itwt/main/itwt_main.c | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 6bd7987d2e..8935edbf3a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 6bd7987d2e580e82a91620da9dcc0ac2bf45723f +Subproject commit 8935edbf3ad6c9ece98dd70c1ee13e88c100a7ed diff --git a/examples/wifi/itwt/main/Kconfig.projbuild b/examples/wifi/itwt/main/Kconfig.projbuild index 8d8dd52b2e..9dc0b28ee4 100644 --- a/examples/wifi/itwt/main/Kconfig.projbuild +++ b/examples/wifi/itwt/main/Kconfig.projbuild @@ -119,7 +119,7 @@ menu "Example Configuration" depends on !IDF_TARGET_ESP32C2 config EXAMPLE_MAX_CPU_FREQ_240 bool "240 MHz" - depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 + depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C5 endchoice config EXAMPLE_MAX_CPU_FREQ_MHZ @@ -131,7 +131,8 @@ menu "Example Configuration" choice EXAMPLE_MIN_CPU_FREQ prompt "Minimum CPU frequency" - default EXAMPLE_MIN_CPU_FREQ_10M + default EXAMPLE_MIN_CPU_FREQ_10M if !IDF_TARGET_ESP32C5 + default EXAMPLE_MIN_CPU_FREQ_12M if IDF_TARGET_ESP32C5 depends on PM_ENABLE help Minimum CPU frequency to use for dynamic frequency scaling. @@ -143,6 +144,9 @@ menu "Example Configuration" config EXAMPLE_MIN_CPU_FREQ_20M bool "20 MHz (use with 40MHz XTAL)" depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO + config EXAMPLE_MIN_CPU_FREQ_12M + bool "12 MHz (use with 48MHz XTAL)" + depends on XTAL_FREQ_48 || XTAL_FREQ_AUTO config EXAMPLE_MIN_CPU_FREQ_10M bool "10 MHz (use with 40MHz XTAL)" depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO @@ -161,5 +165,6 @@ menu "Example Configuration" default 10 if EXAMPLE_MIN_CPU_FREQ_10M default 26 if EXAMPLE_MIN_CPU_FREQ_26M default 13 if EXAMPLE_MIN_CPU_FREQ_13M + default 12 if EXAMPLE_MIN_CPU_FREQ_12M endmenu diff --git a/examples/wifi/itwt/main/itwt_main.c b/examples/wifi/itwt/main/itwt_main.c index c1e44d8eb2..ec1bdc29e4 100644 --- a/examples/wifi/itwt/main/itwt_main.c +++ b/examples/wifi/itwt/main/itwt_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -275,9 +275,22 @@ static void wifi_itwt(void) .twt_enable_keep_alive = keep_alive_enabled, }; ESP_ERROR_CHECK(esp_wifi_sta_twt_config(&wifi_twt_config)); +#if CONFIG_SOC_WIFI_SUPPORT_5G + wifi_bandwidths_t bw = { + .ghz_2g = WIFI_BW_HT20, + .ghz_5g = WIFI_BW_HT20, + }; + esp_wifi_set_bandwidths(WIFI_IF_STA, &bw); + wifi_protocols_t protocol = { + .ghz_2g = WIFI_PROTOCOL_11AX, + .ghz_5g = WIFI_PROTOCOL_11AX, + }; + esp_wifi_set_protocols(WIFI_IF_STA, &protocol); +#else esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX); +#endif esp_wifi_set_ps(WIFI_PS_MIN_MODEM); #if CONFIG_EXAMPLE_ENABLE_STATIC_IP