Skip to content

Commit a7c3e8b

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'bugfix/fix_some_wifi_coexist_bugs_20241023_v5.3' into 'release/v5.3'
Bugfix/fix some wifi coexist bugs 20241023 v5.3 See merge request espressif/esp-idf!34414
2 parents 6ae7f18 + d7d4dc7 commit a7c3e8b

34 files changed

+923
-56
lines changed

components/esp_coex/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ if(CONFIG_ESP_COEX_ENABLED)
1919
endif()
2020

2121
if(CONFIG_ESP_WIFI_ENABLED)
22-
list(APPEND srcs "${idf_target}/esp_coex_adapter.c")
22+
list(APPEND srcs "${idf_target}/esp_coex_adapter.c"
23+
"src/coexist_debug_diagram.c"
24+
"src/coexist_debug.c")
2325
endif()
2426
endif()
2527

components/esp_coex/Kconfig

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,201 @@ menu "Wireless Coexistence"
4040
If enabled, coexist power management will be enabled.
4141
endif
4242

43+
config ESP_COEX_GPIO_DEBUG
44+
bool "GPIO debugging for coexistence"
45+
default n
46+
depends on !PM_SLP_DISABLE_GPIO && !PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
47+
help
48+
Support coexistence GPIO debugging
49+
50+
if (ESP_COEX_GPIO_DEBUG)
51+
52+
choice ESP_COEX_GPIO_DEBUG_DIAG
53+
prompt "Debugging Diagram"
54+
default ESP_COEX_GPIO_DEBUG_DIAG_GENERAL
55+
help
56+
Select type of debugging diagram
57+
58+
config ESP_COEX_GPIO_DEBUG_DIAG_GENERAL
59+
bool "General"
60+
config ESP_COEX_GPIO_DEBUG_DIAG_WIFI
61+
bool "Wi-Fi"
62+
63+
endchoice
64+
65+
config ESP_COEX_GPIO_DEBUG_IO_COUNT
66+
int "Max number of debugging GPIOs"
67+
range 0 12
68+
default 12
69+
70+
config ESP_COEX_GPIO_DEBUG_IO_IDX0
71+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 0)
72+
int "Actual IO num for Debug IO ID0"
73+
range 0 SOC_GPIO_OUT_RANGE_MAX
74+
default 15 if IDF_TARGET_ESP32
75+
default 4 if IDF_TARGET_ESP32S2
76+
default 19 if IDF_TARGET_ESP32C3
77+
default 4 if IDF_TARGET_ESP32S3
78+
default 18 if IDF_TARGET_ESP32C2
79+
default 4 if IDF_TARGET_ESP32C6
80+
default 2 if IDF_TARGET_ESP32C5
81+
default 4 if IDF_TARGET_ESP32C61
82+
default 1
83+
84+
config ESP_COEX_GPIO_DEBUG_IO_IDX1
85+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 1)
86+
int "Actual IO num for Debug IO ID1"
87+
range 0 SOC_GPIO_OUT_RANGE_MAX
88+
default 2 if IDF_TARGET_ESP32
89+
default 5 if IDF_TARGET_ESP32S2
90+
default 18 if IDF_TARGET_ESP32C3
91+
default 5 if IDF_TARGET_ESP32S3
92+
default 4 if IDF_TARGET_ESP32C2
93+
default 5 if IDF_TARGET_ESP32C6
94+
default 3 if IDF_TARGET_ESP32C5
95+
default 5 if IDF_TARGET_ESP32C61
96+
default 2
97+
98+
config ESP_COEX_GPIO_DEBUG_IO_IDX2
99+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 2)
100+
int "Actual IO num for Debug IO ID2"
101+
range 0 SOC_GPIO_OUT_RANGE_MAX
102+
default 0 if IDF_TARGET_ESP32
103+
default 6 if IDF_TARGET_ESP32S2
104+
default 4 if IDF_TARGET_ESP32C3
105+
default 6 if IDF_TARGET_ESP32S3
106+
default 5 if IDF_TARGET_ESP32C2
107+
default 6 if IDF_TARGET_ESP32C6
108+
default 4 if IDF_TARGET_ESP32C5
109+
default 6 if IDF_TARGET_ESP32C61
110+
default 3
111+
112+
config ESP_COEX_GPIO_DEBUG_IO_IDX3
113+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 3)
114+
int "Actual IO num for Debug IO ID3"
115+
range 0 SOC_GPIO_OUT_RANGE_MAX
116+
default 4 if IDF_TARGET_ESP32
117+
default 7 if IDF_TARGET_ESP32S2
118+
default 5 if IDF_TARGET_ESP32C3
119+
default 7 if IDF_TARGET_ESP32S3
120+
default 6 if IDF_TARGET_ESP32C2
121+
default 7 if IDF_TARGET_ESP32C6
122+
default 5 if IDF_TARGET_ESP32C5
123+
default 7 if IDF_TARGET_ESP32C61
124+
default 4
125+
126+
config ESP_COEX_GPIO_DEBUG_IO_IDX4
127+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 4)
128+
int "Actual IO num for Debug IO ID4"
129+
range 0 SOC_GPIO_OUT_RANGE_MAX
130+
default 5 if IDF_TARGET_ESP32
131+
default 8 if IDF_TARGET_ESP32S2
132+
default 6 if IDF_TARGET_ESP32C3
133+
default 15 if IDF_TARGET_ESP32S3
134+
default 7 if IDF_TARGET_ESP32C2
135+
default 8 if IDF_TARGET_ESP32C6
136+
default 27 if IDF_TARGET_ESP32C5
137+
default 0 if IDF_TARGET_ESP32C61
138+
default 5
139+
140+
config ESP_COEX_GPIO_DEBUG_IO_IDX5
141+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 5)
142+
int "Actual IO num for Debug IO ID5"
143+
range 0 SOC_GPIO_OUT_RANGE_MAX
144+
default 18 if IDF_TARGET_ESP32
145+
default 9 if IDF_TARGET_ESP32S2
146+
default 7 if IDF_TARGET_ESP32C3
147+
default 16 if IDF_TARGET_ESP32S3
148+
default 8 if IDF_TARGET_ESP32C2
149+
default 10 if IDF_TARGET_ESP32C6
150+
default 6 if IDF_TARGET_ESP32C5
151+
default 1 if IDF_TARGET_ESP32C61
152+
default 6
153+
154+
config ESP_COEX_GPIO_DEBUG_IO_IDX6
155+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 6)
156+
int "Actual IO num for Debug IO ID6"
157+
range 0 SOC_GPIO_OUT_RANGE_MAX
158+
default 19 if IDF_TARGET_ESP32
159+
default 10 if IDF_TARGET_ESP32S2
160+
default 8 if IDF_TARGET_ESP32C3
161+
default 17 if IDF_TARGET_ESP32S3
162+
default 9 if IDF_TARGET_ESP32C2
163+
default 11 if IDF_TARGET_ESP32C6
164+
default 7 if IDF_TARGET_ESP32C5
165+
default 8 if IDF_TARGET_ESP32C61
166+
default 7
167+
168+
config ESP_COEX_GPIO_DEBUG_IO_IDX7
169+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 7)
170+
int "Actual IO num for Debug IO ID7"
171+
range 0 SOC_GPIO_OUT_RANGE_MAX
172+
default 22 if IDF_TARGET_ESP32
173+
default 11 if IDF_TARGET_ESP32S2
174+
default 9 if IDF_TARGET_ESP32C3
175+
default 18 if IDF_TARGET_ESP32S3
176+
default 10 if IDF_TARGET_ESP32C2
177+
default 2 if IDF_TARGET_ESP32C6
178+
default 26 if IDF_TARGET_ESP32C5
179+
default 2 if IDF_TARGET_ESP32C61
180+
default 8
181+
182+
config ESP_COEX_GPIO_DEBUG_IO_IDX8
183+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 8)
184+
int "Actual IO num for Debug IO ID8"
185+
range 0 SOC_GPIO_OUT_RANGE_MAX
186+
default 13 if IDF_TARGET_ESP32
187+
default 12 if IDF_TARGET_ESP32S2
188+
default 10 if IDF_TARGET_ESP32C3
189+
default 10 if IDF_TARGET_ESP32S3
190+
default 1 if IDF_TARGET_ESP32C2
191+
default 15 if IDF_TARGET_ESP32C6
192+
default 24 if IDF_TARGET_ESP32C5
193+
default 3 if IDF_TARGET_ESP32C61
194+
default 9
195+
196+
config ESP_COEX_GPIO_DEBUG_IO_IDX9
197+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 9)
198+
int "Actual IO num for Debug IO ID9"
199+
range 0 SOC_GPIO_OUT_RANGE_MAX
200+
default 12 if IDF_TARGET_ESP32
201+
default 13 if IDF_TARGET_ESP32S2
202+
default 0 if IDF_TARGET_ESP32C3
203+
default 11 if IDF_TARGET_ESP32S3
204+
default 0 if IDF_TARGET_ESP32C2
205+
default 23 if IDF_TARGET_ESP32C6
206+
default 23 if IDF_TARGET_ESP32C5
207+
default 9 if IDF_TARGET_ESP32C61
208+
default 10
209+
210+
config ESP_COEX_GPIO_DEBUG_IO_IDX10
211+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 10)
212+
int "Actual IO num for Debug IO ID10"
213+
range 0 SOC_GPIO_OUT_RANGE_MAX
214+
default 14 if IDF_TARGET_ESP32
215+
default 14 if IDF_TARGET_ESP32S2
216+
default 3 if IDF_TARGET_ESP32C3
217+
default 12 if IDF_TARGET_ESP32S3
218+
default 3 if IDF_TARGET_ESP32C2
219+
default 22 if IDF_TARGET_ESP32C6
220+
default 10 if IDF_TARGET_ESP32C5
221+
default 13 if IDF_TARGET_ESP32C61
222+
default 11
223+
224+
config ESP_COEX_GPIO_DEBUG_IO_IDX11
225+
depends on (ESP_COEX_GPIO_DEBUG_IO_COUNT > 11)
226+
int "Actual IO num for Debug IO ID11"
227+
range 0 SOC_GPIO_OUT_RANGE_MAX
228+
default 27 if IDF_TARGET_ESP32
229+
default 15 if IDF_TARGET_ESP32S2
230+
default 2 if IDF_TARGET_ESP32C3
231+
default 13 if IDF_TARGET_ESP32S3
232+
default 2 if IDF_TARGET_ESP32C2
233+
default 21 if IDF_TARGET_ESP32C6
234+
default 9 if IDF_TARGET_ESP32C5
235+
default 12 if IDF_TARGET_ESP32C61
236+
default 12
237+
238+
endif
239+
43240
endmenu # Wireless Coexistence

components/esp_coex/esp32/esp_coex_adapter.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -20,6 +20,7 @@
2020
#include "esp_timer.h"
2121
#include "private/esp_coexist_adapter.h"
2222
#include "esp32/rom/ets_sys.h"
23+
#include "private/esp_coexist_debug.h"
2324

2425
#define TAG "esp_coex_adapter"
2526

@@ -206,6 +207,15 @@ static int32_t esp_coex_internal_semphr_give_wrapper(void *semphr)
206207
return (int32_t)xSemaphoreGive(((modem_static_queue_t *)semphr)->handle);
207208
}
208209

210+
static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
211+
{
212+
#if CONFIG_ESP_COEX_GPIO_DEBUG
213+
return esp_coexist_debug_matrix_init(evt, sig, rev);
214+
#else
215+
return ESP_ERR_NOT_SUPPORTED;
216+
#endif
217+
}
218+
209219
coex_adapter_funcs_t g_coex_adapter_funcs = {
210220
._version = COEX_ADAPTER_VERSION,
211221
._spin_lock_create = esp_coex_common_spin_lock_create_wrapper,
@@ -227,5 +237,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
227237
._timer_done = esp_coex_common_timer_done_wrapper,
228238
._timer_setfn = esp_coex_common_timer_setfn_wrapper,
229239
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
240+
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
230241
._magic = COEX_ADAPTER_MAGIC,
231242
};

components/esp_coex/esp32c2/esp_coex_adapter.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -22,6 +22,7 @@
2222
#include "esp_private/esp_clk.h"
2323
#include "private/esp_coexist_adapter.h"
2424
#include "esp32c2/rom/ets_sys.h"
25+
#include "private/esp_coexist_debug.h"
2526

2627
#define TAG "esp_coex_adapter"
2728

@@ -142,6 +143,20 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi
142143
return (int32_t)xSemaphoreGiveFromISR(semphr, hptw);
143144
}
144145

146+
static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
147+
{
148+
#if CONFIG_ESP_COEX_GPIO_DEBUG
149+
return esp_coexist_debug_matrix_init(evt, sig, rev);
150+
#else
151+
return ESP_ERR_NOT_SUPPORTED;
152+
#endif
153+
}
154+
155+
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
156+
{
157+
return rtc_clk_xtal_freq_get();
158+
}
159+
145160
coex_adapter_funcs_t g_coex_adapter_funcs = {
146161
._version = COEX_ADAPTER_VERSION,
147162
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -161,5 +176,7 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
161176
._timer_done = esp_coex_common_timer_done_wrapper,
162177
._timer_setfn = esp_coex_common_timer_setfn_wrapper,
163178
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
179+
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
180+
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
164181
._magic = COEX_ADAPTER_MAGIC,
165182
};

components/esp_coex/esp32c3/esp_coex_adapter.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -23,6 +23,7 @@
2323
#include "private/esp_coexist_adapter.h"
2424
#include "esp32c3/rom/ets_sys.h"
2525
#include "soc/system_reg.h"
26+
#include "private/esp_coexist_debug.h"
2627

2728
#define TAG "esp_coex_adapter"
2829

@@ -148,6 +149,15 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi
148149
return (int32_t)xSemaphoreGiveFromISR(semphr, hptw);
149150
}
150151

152+
static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
153+
{
154+
#if CONFIG_ESP_COEX_GPIO_DEBUG
155+
return esp_coexist_debug_matrix_init(evt, sig, rev);
156+
#else
157+
return ESP_ERR_NOT_SUPPORTED;
158+
#endif
159+
}
160+
151161
coex_adapter_funcs_t g_coex_adapter_funcs = {
152162
._version = COEX_ADAPTER_VERSION,
153163
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -165,5 +175,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
165175
._timer_done = esp_coex_common_timer_done_wrapper,
166176
._timer_setfn = esp_coex_common_timer_setfn_wrapper,
167177
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
178+
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
168179
._magic = COEX_ADAPTER_MAGIC,
169180
};

components/esp_coex/esp32c5/esp_coex_adapter.c

Lines changed: 18 additions & 1 deletion
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
*/
@@ -21,6 +21,7 @@
2121
#include "esp_private/esp_clk.h"
2222
#include "private/esp_coexist_adapter.h"
2323
#include "esp32c5/rom/ets_sys.h"
24+
#include "private/esp_coexist_debug.h"
2425

2526
#define TAG "esp_coex_adapter"
2627

@@ -141,6 +142,20 @@ static int32_t IRAM_ATTR esp_coex_semphr_give_from_isr_wrapper(void *semphr, voi
141142
return (int32_t)xSemaphoreGiveFromISR(semphr, hptw);
142143
}
143144

145+
static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
146+
{
147+
#if CONFIG_ESP_COEX_GPIO_DEBUG
148+
return esp_coexist_debug_matrix_init(evt, sig, rev);
149+
#else
150+
return ESP_ERR_NOT_SUPPORTED;
151+
#endif
152+
}
153+
154+
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
155+
{
156+
return rtc_clk_xtal_freq_get();
157+
}
158+
144159
coex_adapter_funcs_t g_coex_adapter_funcs = {
145160
._version = COEX_ADAPTER_VERSION,
146161
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -159,5 +174,7 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
159174
._timer_done = esp_coex_common_timer_done_wrapper,
160175
._timer_setfn = esp_coex_common_timer_setfn_wrapper,
161176
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
177+
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
178+
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
162179
._magic = COEX_ADAPTER_MAGIC,
163180
};

0 commit comments

Comments
 (0)