Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_some_wifi_bugs_231214_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
fix(wifi): fix some wifi bugs 231214 (Backport v5.1)

See merge request espressif/esp-idf!27943
  • Loading branch information
jack0c committed Dec 20, 2023
2 parents acb84ca + b0493e0 commit 2c564d3
Show file tree
Hide file tree
Showing 51 changed files with 448 additions and 357 deletions.
2 changes: 1 addition & 1 deletion components/bt/controller/esp32/bt.c
Expand Up @@ -35,7 +35,7 @@
#include "soc/rtc.h"
#include "soc/soc_memory_layout.h"
#include "soc/dport_reg.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp_timer.h"
#if !CONFIG_FREERTOS_UNICORE
#include "esp_ipc.h"
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/esp32c2/bt.c
Expand Up @@ -24,7 +24,7 @@
#endif

#if CONFIG_SW_COEXIST_ENABLE
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#endif

#include "nimble/nimble_npl_os.h"
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/esp32c3/bt.c
Expand Up @@ -34,7 +34,7 @@
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/soc_memory_layout.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp_timer.h"
#include "esp_sleep.h"
#include "esp_rom_sys.h"
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/esp32c6/bt.c
Expand Up @@ -24,7 +24,7 @@
#endif // ESP_PLATFORM

#if CONFIG_SW_COEXIST_ENABLE
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#endif // CONFIG_SW_COEXIST_ENABLE

#include "nimble/nimble_npl_os.h"
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/esp32h2/bt.c
Expand Up @@ -24,7 +24,7 @@
#endif // ESP_PLATFORM

#if CONFIG_SW_COEXIST_ENABLE
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#endif // CONFIG_SW_COEXIST_ENABLE

#include "nimble/nimble_npl_os.h"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32/esp_coex_adapter.c
Expand Up @@ -18,7 +18,7 @@
#include "freertos/portmacro.h"
#include "esp_heap_caps.h"
#include "esp_timer.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32/rom/ets_sys.h"

#define TAG "esp_coex_adapter"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32c2/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32c2/rom/ets_sys.h"

#define TAG "esp_coex_adapter"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32c3/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32c3/rom/ets_sys.h"
#include "soc/system_reg.h"

Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32c6/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32c6/rom/ets_sys.h"

#define TAG "esp_coex_adapter"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32h2/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32c6/rom/ets_sys.h"

#define TAG "esp_coex_adapter"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32s2/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32s2/rom/ets_sys.h"

#define TAG "esp_coex_adapter"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/esp32s3/esp_coex_adapter.c
Expand Up @@ -20,7 +20,7 @@
#include "esp_timer.h"
#include "soc/rtc.h"
#include "esp_private/esp_clk.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"
#include "esp32s3/rom/ets_sys.h"
#include "soc/system_reg.h"

Expand Down
Expand Up @@ -9,7 +9,7 @@

#include <stdbool.h>
#include "esp_coexist.h"
#include "esp_coexist_adapter.h"
#include "private/esp_coexist_adapter.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -173,7 +173,6 @@ int coex_register_bt_cb(coex_func_cb_t callback);
* @brief To acquire the spin-lock used in resetting Bluetooth baseband.
* This function is only used to workaround ESP32 hardware issue.
*
* @param callback: callback function registered to coexistence module
* @return : value of the spinlock to be restored
*/
uint32_t coex_bb_reset_lock(void);
Expand Down Expand Up @@ -268,7 +267,7 @@ void * coex_schm_curr_phase_get(void);
/**
* @brief Set current coexistence scheme phase index.
*
* @param interval : Coexistence scheme phase index
* @param idx : Coexistence scheme phase index
* @return : 0 - success, other - failed
*/
int coex_schm_curr_phase_idx_set(int idx);
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/src/coexist.c
Expand Up @@ -5,7 +5,7 @@
*/

#include "esp_coexist.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"

#if CONFIG_EXTERNAL_COEX_ENABLE
#include "esp_log.h"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_coex/test_md5/test_md5.sh
Expand Up @@ -58,7 +58,7 @@ function check_md5()
}

echo "Checking libraries for target ${IDF_TARGET}..."
check_md5 ${IDF_PATH}/components/esp_coex/include/esp_coexist_adapter.h g_coex_adapter_funcs_md5
check_md5 ${IDF_PATH}/components/esp_coex/include/private/esp_coexist_adapter.h g_coex_adapter_funcs_md5

case $IDF_TARGET in
esp32c6|esp32h2)
Expand Down
1 change: 0 additions & 1 deletion components/esp_common/include/esp_err.h
Expand Up @@ -78,7 +78,6 @@ const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen);
/** @cond */
void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) __attribute__((__noreturn__));

/** @cond */
void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int line, const char *function, const char *expression);

#ifndef __ASSERT_FUNC
Expand Down
13 changes: 11 additions & 2 deletions components/esp_psram/Kconfig.spiram.common
Expand Up @@ -13,11 +13,20 @@ config SPIRAM_BOOT_INIT
config SPIRAM_IGNORE_NOTFOUND
bool "Ignore PSRAM when not found"
default "n"
depends on SPIRAM_BOOT_INIT && !SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
depends on SPIRAM_BOOT_INIT && !SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY && !SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY
help
Normally, if psram initialization is enabled during compile time but not found at runtime, it
is seen as an error making the CPU panic. If this is enabled, booting will complete
but no PSRAM will be available.
but no PSRAM will be available. If PSRAM failed to initialize, the following configs may be affected
and may need to be corrected manually. SPIRAM_TRY_ALLOCATE_WIFI_LWIP will affect some LWIP and WiFi buffer
default values and range values. Enable SPIRAM_TRY_ALLOCATE_WIFI_LWIP, ESP_WIFI_AMSDU_TX_ENABLED,
ESP_WIFI_CACHE_TX_BUFFER_NUM and use static WiFi Tx buffer may cause potential memory exhaustion issues.
Suggest disable SPIRAM_TRY_ALLOCATE_WIFI_LWIP.
Suggest disable ESP_WIFI_AMSDU_TX_ENABLED.
Suggest disable ESP_WIFI_CACHE_TX_BUFFER_NUM, need clear CONFIG_FEATURE_CACHE_TX_BUF_BIT of
config->feature_caps.
Suggest change ESP_WIFI_TX_BUFFER from static to dynamic. Also suggest to adjust some buffer numbers to the
values used without PSRAM case. Such as, ESP_WIFI_STATIC_TX_BUFFER_NUM, ESP_WIFI_DYNAMIC_TX_BUFFER_NUM.

choice SPIRAM_USE
prompt "SPI RAM access method"
Expand Down
2 changes: 1 addition & 1 deletion components/esp_system/startup.c
Expand Up @@ -38,7 +38,7 @@
/***********************************************/
// Headers for other components init functions
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#endif

#if __has_include("esp_app_desc.h")
Expand Down
4 changes: 4 additions & 0 deletions components/esp_wifi/CMakeLists.txt
Expand Up @@ -66,4 +66,8 @@ if(CONFIG_ESP_WIFI_ENABLED)
endforeach()
endif()

if(CONFIG_SPIRAM)
idf_component_optional_requires(PRIVATE esp_psram)
endif()

endif()
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32/esp_adapter.c
Expand Up @@ -39,11 +39,11 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "dport_access.h"
#include "esp_rom_sys.h"
#include "esp32/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"

#define TAG "esp_adapter"

Expand Down
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32c2/esp_adapter.c
Expand Up @@ -40,9 +40,9 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp32c2/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"

#define TAG "esp_adapter"

Expand Down
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32c3/esp_adapter.c
Expand Up @@ -41,9 +41,9 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp32c3/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"

#define TAG "esp_adapter"

Expand Down
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32c6/esp_adapter.c
Expand Up @@ -40,9 +40,9 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp32c6/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"
#include "esp_private/esp_modem_clock.h"

#if SOC_PM_MODEM_RETENTION_BY_REGDMA
Expand Down
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32s2/esp_adapter.c
Expand Up @@ -41,10 +41,10 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp_rom_sys.h"
#include "esp32s2/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"

#define TAG "esp_adapter"

Expand Down
4 changes: 2 additions & 2 deletions components/esp_wifi/esp32s3/esp_adapter.c
Expand Up @@ -42,10 +42,10 @@
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#include "esp_coexist_internal.h"
#include "private/esp_coexist_internal.h"
#include "esp_rom_sys.h"
#include "esp32s3/rom/ets_sys.h"
#include "esp_modem_wrapper.h"
#include "private/esp_modem_wrapper.h"

#define TAG "esp_adapter"

Expand Down
13 changes: 8 additions & 5 deletions components/esp_wifi/include/esp_mesh.h
Expand Up @@ -136,10 +136,13 @@ extern "C" {
/**
* @brief Flag of mesh networking IE
*/
#define MESH_ASSOC_FLAG_VOTE_IN_PROGRESS (0x02) /**< vote in progress */
#define MESH_ASSOC_FLAG_MAP_ASSOC (0x01) /**< Mesh AP doesn't detect children leave yet */
#define MESH_ASSOC_FLAG_VOTE_IN_PROGRESS (0x02) /**< station in vote, set when root vote start, clear when connect to router or when root switch*/
#define MESH_ASSOC_FLAG_STA_VOTED (0x04) /**< station vote done, set when connect to router */
#define MESH_ASSOC_FLAG_NETWORK_FREE (0x08) /**< no root in current network */
#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< root conflict is found */
#define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< fixed root */
#define MESH_ASSOC_FLAG_STA_VOTE_EXPIRE (0x10) /**< the voted address is expired, means the voted device lose the chance to be root */
#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that thre are at least two roots in the mesh network */
#define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< the root is fixed in the mesh network */


/**
Expand Down Expand Up @@ -1291,7 +1294,7 @@ int esp_mesh_get_capacity_num(void);
/**
* @brief Set mesh IE crypto functions
*
* @attention This API can be called at any time after mesh is initialized.
* @attention This API can be called at any time after mesh is configured.
*
* @param[in] crypto_funcs crypto functions for mesh IE
* - If crypto_funcs is set to NULL, mesh IE is no longer encrypted.
Expand All @@ -1303,7 +1306,7 @@ esp_err_t esp_mesh_set_ie_crypto_funcs(const mesh_crypto_funcs_t *crypto_funcs);
/**
* @brief Set mesh IE crypto key
*
* @attention This API can be called at any time after mesh is initialized.
* @attention This API can be called at any time after mesh is configured.
*
* @param[in] key ASCII crypto key
* @param[in] len length in bytes, range:8~64
Expand Down

0 comments on commit 2c564d3

Please sign in to comment.