From cdd8c1e26129896c20e72d00dbe467970f4433dc Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Thu, 28 Aug 2025 15:54:41 +0800 Subject: [PATCH 1/3] feat(coex): add 802.15.4 status for coex --- components/esp_coex/include/esp_coex_i154.h | 37 +++++++++++++++++++ .../include/private/esp_coexist_internal.h | 2 + components/esp_coex/src/coexist.c | 6 ++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/components/esp_coex/include/esp_coex_i154.h b/components/esp_coex/include/esp_coex_i154.h index d601205ebe7..f817e901400 100644 --- a/components/esp_coex/include/esp_coex_i154.h +++ b/components/esp_coex/include/esp_coex_i154.h @@ -6,6 +6,9 @@ #ifndef __COEXIST_I154_H__ #define __COEXIST_I154_H__ +/** + * @brief 802.15.4 coex event + */ typedef enum { IEEE802154_HIGH = 1, IEEE802154_MIDDLE, @@ -14,16 +17,50 @@ typedef enum { IEEE802154_EVENT_MAX, } ieee802154_coex_event_t; +/** + * @brief 802.15.4 coexistence configurations + */ typedef struct { ieee802154_coex_event_t idle; ieee802154_coex_event_t txrx; ieee802154_coex_event_t txrx_at; } esp_ieee802154_coex_config_t; +/** + * @brief Set 802.15.4 tx/rx pti + * @param 802.15.4 coexistence event + */ void esp_coex_ieee802154_txrx_pti_set(ieee802154_coex_event_t event); + +/** + * @brief Set 802.15.4 ack pti + * @param 802.15.4 coexistence event + */ void esp_coex_ieee802154_ack_pti_set(ieee802154_coex_event_t event); + +/** + * @brief Indicate that a coexistence break occurred in 802.15.4 + */ void esp_coex_ieee802154_coex_break_notify(void); + +/** + * @brief Enter the TX stage for 802.15.4 external coexistence handling + */ void esp_coex_ieee802154_extcoex_tx_stage(void); + +/** + * @brief Enter the RX stage for 802.15.4 external coexistence handling + */ void esp_coex_ieee802154_extcoex_rx_stage(void); +/** + * @brief Enable the 802.15.4 status for coexistence + */ +void esp_coex_ieee802154_status_enable(void); + +/** + * @brief Disable the 802.15.4 status for coexistence + */ +void esp_coex_ieee802154_status_disable(void); + #endif diff --git a/components/esp_coex/include/private/esp_coexist_internal.h b/components/esp_coex/include/private/esp_coexist_internal.h index 6e3799487f0..026f1f9fe0a 100644 --- a/components/esp_coex/include/private/esp_coexist_internal.h +++ b/components/esp_coex/include/private/esp_coexist_internal.h @@ -32,6 +32,8 @@ typedef enum { COEX_SCHM_ST_TYPE_WIFI = 0, COEX_SCHM_ST_TYPE_BLE, COEX_SCHM_ST_TYPE_BT, + COEX_SCHM_ST_TYPE_EXTERNAL_COEX, + COEX_SCHM_ST_TYPE_I154, } coex_schm_st_type_t; #define COEX_STATUS_GET_WIFI_BITMAP (1 << COEX_SCHM_ST_TYPE_WIFI) diff --git a/components/esp_coex/src/coexist.c b/components/esp_coex/src/coexist.c index da83b47a944..d2b5a3127e3 100644 --- a/components/esp_coex/src/coexist.c +++ b/components/esp_coex/src/coexist.c @@ -19,6 +19,10 @@ #include "esp_private/periph_ctrl.h" +#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_SOC_IEEE802154_SUPPORTED +#include "esp_coex_i154.h" +#endif + #if SOC_EXTERNAL_COEX_ADVANCE #define EXTERNAL_COEX_SIGNAL_I0_IDX EXTERN_ACTIVE_I_IDX #define EXTERNAL_COEX_SIGNAL_I1_IDX EXTERN_PRIORITY_I_IDX @@ -286,7 +290,7 @@ esp_err_t esp_coex_wifi_i154_enable(void) // TODO: Add a scheme for wifi and 154 coex. // Remove this function if FCC-50 closes. coex_enable(); - coex_schm_status_bit_set(1, 1); + esp_coex_ieee802154_status_enable(); return ESP_OK; } #endif From c7ad5f20cef136faea8ee6dc952308e8655b1b85 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Wed, 27 May 2026 17:28:42 +0800 Subject: [PATCH 2/3] fix(coex): move 15.4 register configuration to 15.4 init --- components/esp_coex/include/esp_coex_i154.h | 10 +++++++++- components/ieee802154/driver/esp_ieee802154_dev.c | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/esp_coex/include/esp_coex_i154.h b/components/esp_coex/include/esp_coex_i154.h index f817e901400..ee20845770a 100644 --- a/components/esp_coex/include/esp_coex_i154.h +++ b/components/esp_coex/include/esp_coex_i154.h @@ -1,11 +1,13 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #ifndef __COEXIST_I154_H__ #define __COEXIST_I154_H__ +#include + /** * @brief 802.15.4 coex event */ @@ -63,4 +65,10 @@ void esp_coex_ieee802154_status_enable(void); */ void esp_coex_ieee802154_status_disable(void); +/** + * @brief Configure the 802.15.4 force Rx state + * @param enable true to enable, false to disable + */ +void esp_coex_ieee802154_force_rx_enable(bool enable); + #endif diff --git a/components/ieee802154/driver/esp_ieee802154_dev.c b/components/ieee802154/driver/esp_ieee802154_dev.c index 5b7acbbec0f..4086addd370 100644 --- a/components/ieee802154/driver/esp_ieee802154_dev.c +++ b/components/ieee802154/driver/esp_ieee802154_dev.c @@ -925,12 +925,19 @@ esp_err_t ieee802154_mac_init(void) ESP_RETURN_ON_FALSE(ieee802154_sleep_init() == ESP_OK, ESP_FAIL, IEEE802154_TAG, "IEEE802154 MAC sleep init failed"); +#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE + esp_coex_ieee802154_force_rx_enable(true); +#endif + return ret; } esp_err_t ieee802154_mac_deinit(void) { esp_err_t ret = ESP_OK; +#if CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE + esp_coex_ieee802154_force_rx_enable(false); +#endif if (s_ieee802154_isr_handle) { ret = esp_intr_free(s_ieee802154_isr_handle); s_ieee802154_isr_handle = NULL; From 3bbb0c24a80daa4767814f00b057c0ee23c64f90 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Tue, 14 Jul 2026 20:07:34 +0800 Subject: [PATCH 3/3] fix(coex): fix some coex bugs 20260727 v5.2 1. feat(coex): add 802.15.4 status for coex 2. fix(coex): fix ieee802.15.4 external coex tx/rx stage handling 3. fix(coex): move 15.4 register configuration to 15.4 init 4. fix(coex): fix coex status get issue --- components/esp_coex/lib | 2 +- components/esp_wifi/lib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_coex/lib b/components/esp_coex/lib index c3c29994977..bfe5f91f424 160000 --- a/components/esp_coex/lib +++ b/components/esp_coex/lib @@ -1 +1 @@ -Subproject commit c3c29994977b67e307a46350f333645c83463cdd +Subproject commit bfe5f91f424b6b39b59ff4d6c80cf6c35888b87c diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 741d2289270..05d580f9e7b 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 741d22892706cca06959f2cfd2c8c690ba73feff +Subproject commit 05d580f9e7b13f2c796ddae4efdc8ca74d4c0c86