Merge branch 'bugfix/fix_some_coex_bugs_260727_v5.2' into 'release/v5.2'

fix(coex): fix some coex bugs 20260727 v5.2(Backport v5.2)

See merge request espressif/esp-idf!51208
This commit is contained in:
Jiang Jiang Jian
2026-07-29 10:48:59 +08:00
6 changed files with 62 additions and 4 deletions
+46 -1
View File
@@ -1,11 +1,16 @@
/*
* 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 <stdbool.h>
/**
* @brief 802.15.4 coex event
*/
typedef enum {
IEEE802154_HIGH = 1,
IEEE802154_MIDDLE,
@@ -14,16 +19,56 @@ 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);
/**
* @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
@@ -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)
+5 -1
View File
@@ -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
@@ -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;