Skip to content

Commit

Permalink
feat(wifi): add esp32c5 beta3 wifi support
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiao111 committed Apr 10, 2024
1 parent 8ea943e commit 27f6196
Show file tree
Hide file tree
Showing 29 changed files with 1,295 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci
write-changes = true
10 changes: 6 additions & 4 deletions components/bt/controller/esp32/bt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -35,7 +35,9 @@
#include "soc/rtc.h"
#include "soc/soc_memory_layout.h"
#include "soc/dport_reg.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_timer.h"
#if !CONFIG_FREERTOS_UNICORE
#include "esp_ipc.h"
Expand Down Expand Up @@ -760,7 +762,7 @@ static int32_t queue_send_hlevel_wrapper(void *queue, void *item, uint32_t block
* @param item The message which will be send
* @param hptw need do task yield or not
* @return send success or not
* There is an issue here: When the queue is full, it may reture true but it send fail to the queue, sometimes.
* There is an issue here: When the queue is full, it may return true but it send fail to the queue, sometimes.
* But in Bluetooth controller's isr, We don't care about the return value.
* It only required tp send success when the queue is empty all the time.
* So, this function meets the requirement.
Expand Down Expand Up @@ -1695,7 +1697,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)

sdk_config_set_bt_pll_track_enable(true);

// inititalize bluetooth baseband
// initialize bluetooth baseband
btdm_check_and_init_bb();

ret = btdm_controller_enable(mode);
Expand Down Expand Up @@ -1858,7 +1860,7 @@ esp_err_t esp_ble_scan_dupilcate_list_flush(void)

/**
* This function re-write controller's function,
* As coredump can not show paramerters in function which is in a .a file.
* As coredump can not show parameters in function which is in a .a file.
*
* After coredump fixing this issue, just delete this function.
*/
Expand Down
4 changes: 3 additions & 1 deletion components/bt/controller/esp32c3/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "esp_task.h"
#include "esp_attr.h"
#include "esp_phy_init.h"
#include "esp_private/phy.h"
#include "esp_bt.h"
#include "esp_err.h"
#include "esp_log.h"
Expand All @@ -34,11 +35,12 @@
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/soc_memory_layout.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp_timer.h"
#include "esp_sleep.h"
#include "esp_rom_sys.h"
#include "esp_private/phy.h"
#if CONFIG_IDF_TARGET_ESP32C3
#include "riscv/interrupt.h"
#include "esp32c3/rom/rom_layout.h"
Expand Down
1 change: 1 addition & 0 deletions components/esp_hw_support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ if(NOT BOOTLOADER_BUILD)
if(CONFIG_IDF_TARGET_ESP32C5)
list(REMOVE_ITEM srcs
"sleep_modes.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_modem.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_wake_stub.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"sleep_gpio.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
"port/esp_clk_tree_common.c" # TODO: [ESP32C5] IDF-8638, IDF-8640
Expand Down
3 changes: 3 additions & 0 deletions components/esp_phy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ if(CONFIG_ESP_PHY_ENABLED)
target_link_libraries(${COMPONENT_LIB} PUBLIC btbb)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a libbtbb.a
$<TARGET_FILE:${esp_phy_lib}>)
elseif(CONFIG_SOC_WIFI_SUPPORTED)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${esp_phy_lib}> libphy.a
$<TARGET_FILE:${esp_phy_lib}>)
endif()

if(CONFIG_ESP_PHY_ENABLE_CERT_TEST)
Expand Down
60 changes: 49 additions & 11 deletions components/esp_wifi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ menu "Wi-Fi"

config ESP_WIFI_EXTRA_IRAM_OPT
bool "WiFi EXTRA IRAM speed optimization"
default y if IDF_TARGET_ESP32C6
default y if SOC_WIFI_HE_SUPPORT
default n
help
Select this option to place additional frequently called Wi-Fi library functions
Expand Down Expand Up @@ -335,6 +335,7 @@ menu "Wi-Fi"
bool "WiFi SLP IRAM speed optimization"
select PM_SLP_DEFAULT_PARAMS_OPT
select PERIPH_CTRL_FUNC_IN_IRAM
default y if SOC_WIFI_HE_SUPPORT
help
Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
Some functions can be put in IRAM either by ESP_WIFI_IRAM_OPT and ESP_WIFI_RX_IRAM_OPT, or this one.
Expand Down Expand Up @@ -470,14 +471,6 @@ menu "Wi-Fi"
help
Enable WiFi Aware (NAN) feature.

config ESP_WIFI_ENABLE_WIFI_TX_STATS
bool "Enable Wi-Fi transmission statistics"
depends on SOC_WIFI_HE_SUPPORT
default "y"
help
Enable Wi-Fi transmission statistics. Total support 4 access category. Each access category
will use 346 bytes memory.

config ESP_WIFI_MBEDTLS_CRYPTO
bool "Use MbedTLS crypto APIs"
default y
Expand Down Expand Up @@ -614,21 +607,66 @@ menu "Wi-Fi"
help
Select this option to enable WPS registrar support in softAP mode.

config ESP_WIFI_ENABLE_WIFI_TX_STATS
bool "Enable Wi-Fi transmission statistics"
depends on SOC_WIFI_HE_SUPPORT
default n
help
Enable Wi-Fi transmission statistics. Total support 4 access category. Each access category
will use 346 bytes memory.

config ESP_WIFI_ENABLE_WIFI_RX_STATS
bool "Enable Wi-Fi reception statistics"
depends on SOC_WIFI_HE_SUPPORT
default "y"
default n
help
Enable Wi-Fi reception statistics. Total support 2 access category. Each access category
will use 190 bytes memory.

config ESP_WIFI_ENABLE_WIFI_RX_MU_STATS
bool "Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics"
depends on ESP_WIFI_ENABLE_WIFI_RX_STATS
default "y"
default n
help
Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics. Will use 10932 bytes memory.

config ESP_WIFI_TX_HETB_QUEUE_NUM
int "WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission"
depends on SOC_WIFI_HE_SUPPORT
range 1 4
default 3
help
Set the maximum number of queue that can be aggregated by the STA in the A-MPDU carried in the
HE TB PPDU.

config ESP_WIFI_ENABLE_DUMP_HESIGB
bool "Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs.

config ESP_WIFI_ENABLE_DUMP_MU_CFO
bool "Enable Wi-Fi dump MU CFO"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump MU CFO.

config ESP_WIFI_ENABLE_DUMP_CTRL_NDPA
bool "Enable Wi-Fi dump NDPA frames"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump NDPA frames.

config ESP_WIFI_ENABLE_DUMP_CTRL_BFRP
bool "Enable Wi-Fi dump BFRP frames"
depends on SOC_WIFI_HE_SUPPORT_5G
default "n"
help
Enable Wi-Fi dump BFRP frames.

menu "WPS Configuration Options"
config ESP_WIFI_WPS_STRICT
bool "Strictly validate all WPS attributes"
Expand Down
6 changes: 5 additions & 1 deletion components/esp_wifi/esp32/esp_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,19 @@
#include "esp_cpu.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/dport_reg.h"
#include "soc/syscon_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "dport_access.h"
#include "esp_rom_sys.h"
#include "esp32/rom/ets_sys.h"
Expand Down
6 changes: 5 additions & 1 deletion components/esp_wifi/esp32c2/esp_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@
#include "esp_timer.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c2/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

Expand Down
6 changes: 5 additions & 1 deletion components/esp_wifi/esp32c3/esp_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@
#include "esp_timer.h"
#include "esp_private/wifi_os_adapter.h"
#include "esp_private/wifi.h"
#ifdef CONFIG_ESP_PHY_ENABLED
#include "esp_phy_init.h"
#include "phy_init_data.h"
#endif
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc.h"
#include "soc/syscon_reg.h"
#include "soc/system_reg.h"
#include "phy_init_data.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "nvs.h"
#include "os.h"
#include "esp_smartconfig.h"
#ifdef CONFIG_ESP_COEX_ENABLED
#include "private/esp_coexist_internal.h"
#endif
#include "esp32c3/rom/ets_sys.h"
#include "private/esp_modem_wrapper.h"

Expand Down
Loading

0 comments on commit 27f6196

Please sign in to comment.