Merge branch 'bugfix/update_esp32c3_docs' into 'master'

Bugfix/update esp32c3 wifi driver docs

See merge request espressif/esp-idf!13274
This commit is contained in:
Jiang Jiang Jian 2021-04-28 07:40:20 +00:00
commit 3c0801584a
3 changed files with 299 additions and 79 deletions

View File

@ -1461,23 +1461,23 @@ Detailed information on creating certificates and how to run wpa2_enterprise exa
.. only:: esp32s2 or esp32c3
Wi-Fi Location
-------------------------------
Wi-Fi Location
-------------------------------
Wi-Fi Location will improve the accuracy of a device's location data beyond the Access Point, which will enable creation of new, feature-rich applications and services such as geo-fencing, network management, navigation and others. One of the protocols used to determine the device location with respect to the Access Point is Fine Timing Measurement which calculates Time-of-Flight of a WiFi frame.
Wi-Fi Location will improve the accuracy of a device's location data beyond the Access Point, which will enable creation of new, feature-rich applications and services such as geo-fencing, network management, navigation and others. One of the protocols used to determine the device location with respect to the Access Point is Fine Timing Measurement which calculates Time-of-Flight of a WiFi frame.
Fine Timing Measurement (FTM)
+++++++++++++++++++++++++++++
Fine Timing Measurement (FTM)
+++++++++++++++++++++++++++++
FTM is used to measure Wi-Fi Round Trip Time (Wi-Fi RTT) which is the time a Wi-Fi signal takes to travel from a device to another device and back again. Using Wi-Fi RTT the distance between the devices can be calculated with a simple formula of `RTT * c / 2`, where c is the speed of light.
FTM uses timestamps given by Wi-Fi interface hardware at the time of arrival or departure of frames exchanged between a pair of devices. One entity called FTM Initiator (mostly a Station device) discovers the FTM Responder (can be a Station or an Access Point) and negotiates to start an FTM procedure. The procedure uses multiple Action frames sent in bursts and its ACK's to gather the timestamps data. FTM Initiator gathers the data in the end to calculate an average Round-Trip-Time.
{IDF_TARGET_NAME} supports FTM in below configuration:
FTM is used to measure Wi-Fi Round Trip Time (Wi-Fi RTT) which is the time a Wi-Fi signal takes to travel from a device to another device and back again. Using Wi-Fi RTT the distance between the devices can be calculated with a simple formula of `RTT * c / 2`, where c is the speed of light.
FTM uses timestamps given by Wi-Fi interface hardware at the time of arrival or departure of frames exchanged between a pair of devices. One entity called FTM Initiator (mostly a Station device) discovers the FTM Responder (can be a Station or an Access Point) and negotiates to start an FTM procedure. The procedure uses multiple Action frames sent in bursts and its ACK's to gather the timestamps data. FTM Initiator gathers the data in the end to calculate an average Round-Trip-Time.
{IDF_TARGET_NAME} supports FTM in below configuration:
- {IDF_TARGET_NAME} as FTM Initiator in Station mode.
- {IDF_TARGET_NAME} as FTM Responder in SoftAP mode.
- {IDF_TARGET_NAME} as FTM Initiator in Station mode.
- {IDF_TARGET_NAME} as FTM Responder in SoftAP mode.
Distance measurement using RTT is not accurate, factors such as RF interference, multi-path travel, antenna orientation and lack of calibration increase these inaccuracies. For better results it is suggested to perform FTM between two {IDF_TARGET_NAME} devices as Station and SoftAP.
Refer to IDF example :idf_file:`examples/wifi/ftm/README.md` for steps on how to setup and perform FTM.
Distance measurement using RTT is not accurate, factors such as RF interference, multi-path travel, antenna orientation and lack of calibration increase these inaccuracies. For better results it is suggested to perform FTM between two {IDF_TARGET_NAME} devices as Station and SoftAP.
Refer to IDF example :idf_file:`examples/wifi/ftm/README.md` for steps on how to setup and perform FTM.
{IDF_TARGET_NAME} Wi-Fi Power-saving Mode
-----------------------------------------
@ -1509,24 +1509,68 @@ In the future, all power save features will be supported on {IDF_TARGET_NAME} AP
The table below shows the best throughput results we got in Espressif's lab and in a shield box.
+----------------------+-----------------+-----------------+---------------+--------------+
| Type/Throughput | Air In Lab | Shield-box | Test Tool | IDF Version |
| | | | | (commit ID) |
+======================+=================+=================+===============+==============+
| Raw 802.11 Packet RX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| Raw 802.11 Packet TX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP RX | 30 MBit/s | 90 MBit/s | iperf example | 05838641 |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP TX | 30 MBit/s | 60 MBit/s | iperf example | 05838641 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP RX | 20 MBit/s | 50 MBit/s | iperf example | 05838641 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP TX | 20 MBit/s | 50 MBit/s | iperf example | 05838641 |
+----------------------+-----------------+-----------------+---------------+--------------+
.. only:: esp32
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.ci.99`.
+----------------------+-----------------+-----------------+---------------+--------------+
| Type/Throughput | Air In Lab | Shield-box | Test Tool | IDF Version |
| | | | | (commit ID) |
+======================+=================+=================+===============+==============+
| Raw 802.11 Packet RX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| Raw 802.11 Packet TX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP RX | 30 MBit/s | 85 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP TX | 30 MBit/s | 75 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP RX | 20 MBit/s | 65 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP TX | 20 MBit/s | 75 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32`.
.. only:: esp32s2
+----------------------+-----------------+-----------------+---------------+--------------+
| Type/Throughput | Air In Lab | Shield-box | Test Tool | IDF Version |
| | | | | (commit ID) |
+======================+=================+=================+===============+==============+
| Raw 802.11 Packet RX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| Raw 802.11 Packet TX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP RX | 30 MBit/s | 70 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP TX | 30 MBit/s | 50 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP RX | 20 MBit/s | 32 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP TX | 20 MBit/s | 37 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32s2`.
.. only:: esp32c3
+----------------------+-----------------+-----------------+---------------+--------------+
| Type/Throughput | Air In Lab | Shield-box | Test Tool | IDF Version |
| | | | | (commit ID) |
+======================+=================+=================+===============+==============+
| Raw 802.11 Packet RX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| Raw 802.11 Packet TX | N/A | **130 MBit/s** | Internal tool | NA |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP RX | 30 MBit/s | 50 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| UDP TX | 30 MBit/s | 40 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP RX | 20 MBit/s | 35 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
| TCP TX | 20 MBit/s | 37 MBit/s | iperf example | 15575346 |
+----------------------+-----------------+-----------------+---------------+--------------+
When the throughput is tested by iperf example, the sdkconfig is :idf_file:`examples/wifi/iperf/sdkconfig.defaults.esp32c3`.
Wi-Fi 80211 Packet Send
---------------------------
@ -1818,12 +1862,18 @@ Theoretically the higher priority AC has better performance than the low priorit
Wi-Fi AMSDU
-------------------------
{IDF_TARGET_NAME} supports receiving AMSDU but doesn't support transmitting AMSDU. The transmitting AMSDU is not necessary since {IDF_TARGET_NAME} has transmitting AMPDU.
{IDF_TARGET_NAME} supports receiving and transmitting AMSDU.
Wi-Fi Fragment
-------------------------
{IDF_TARGET_NAME} supports Wi-Fi receiving fragment, but doesn't support Wi-Fi transmitting fragment. The Wi-Fi transmitting fragment will be supported in future release.
.. only:: esp32 or esp32s2
supports Wi-Fi receiving fragment, but doesn't support Wi-Fi transmitting fragment.
.. only:: esp32c3
ESP32C3 supports Wi-Fi receiving and transmitting fragment.
WPS Enrollee
-------------------------
@ -1930,11 +1980,13 @@ Increasing the size or number of the buffers mentioned above properly can improv
**Throughput optimization by placing code in IRAM:**
- :ref:`CONFIG_ESP32_WIFI_IRAM_OPT`
If this option is enabled, some Wi-Fi functions are moved to IRAM, improving throughput. This increases IRAM usage by 15 kB.
.. only:: esp32 or esp32s2
- :ref:`CONFIG_ESP32_WIFI_RX_IRAM_OPT`
If this option is enabled, some Wi-Fi RX functions are moved to IRAM, improving throughput. This increases IRAM usage by 16 kB.
- :ref:`CONFIG_ESP32_WIFI_IRAM_OPT`
If this option is enabled, some Wi-Fi functions are moved to IRAM, improving throughput. This increases IRAM usage by 15 kB.
- :ref:`CONFIG_ESP32_WIFI_RX_IRAM_OPT`
If this option is enabled, some Wi-Fi RX functions are moved to IRAM, improving throughput. This increases IRAM usage by 16 kB.
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
If this option is enabled, some LWIP functions are moved to IRAM, improving throughput. This increases IRAM usage by 13 kB.
@ -2033,9 +2085,45 @@ The parameters not mentioned in the following table should be set to the default
| UDP RX throughput | 78.1 | 66.7 | 65.3 | 53.8 | 28.5 |
+----------------------------+-------+------------------+---------+---------------+---------+
.. note::
The result is tested with a single stream in a shielded box using an ASUS RT-N66U router.
{IDF_TARGET_NAME}'s CPU is dual core with 240 MHz, {IDF_TARGET_NAME}'s flash is in QIO mode with 80 MHz.
.. only:: esp32c3
+----------------------------+-------+---------+---------+
| Rank | Iperf | Default | Minimum |
+============================+=======+=========+=========+
| Available memory(KB) | 59 | 160 | 180 |
+----------------------------+-------+---------+---------+
| WIFI_STATIC_RX_BUFFER_NUM | 20 | 8 | 3 |
+----------------------------+-------+---------+---------+
| WIFI_DYNAMIC_RX_BUFFER_NUM | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| WIFI_DYNAMIC_TX_BUFFER_NUM | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| WIFI_RX_BA_WIN | 32 | 16 | 6 |
+----------------------------+-------+---------+---------+
| TCP_SND_BUF_DEFAULT(KB) | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| TCP_WND_DEFAULT(KB) | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| WIFI_IRAM_OPT | - | - | - |
+----------------------------+-------+---------+---------+
| WIFI_RX_IRAM_OPT | - | - | - |
+----------------------------+-------+---------+---------+
| LWIP_IRAM_OPTIMIZATION | 13 | 13 | 0 |
+----------------------------+-------+---------+---------+
| TCP TX throughput | 38.1 | 27.2 | 20.4 |
+----------------------------+-------+---------+---------+
| TCP RX throughput | 35.3 | 24.2 | 17.4 |
+----------------------------+-------+---------+---------+
| UDP TX throughput | 40.6 | 38.9 | 34.1 |
+----------------------------+-------+---------+---------+
| UDP RX throughput | 52.4 | 44.5 | 44.2 |
+----------------------------+-------+---------+---------+
.. only:: esp32 or esp32s2
.. note::
The result is tested with a single stream in a shielded box using an ASUS RT-N66U router.
{IDF_TARGET_NAME}'s CPU is dual core with 240 MHz, {IDF_TARGET_NAME}'s flash is in QIO mode with 80 MHz.
.. only:: esp32
@ -2075,11 +2163,26 @@ The parameters not mentioned in the following table should be set to the default
- **Minimum rank**
This is the minimum configuration rank of {IDF_TARGET_NAME}. The protocol stack only uses the necessary memory for running. It is suitable for scenarios that have no requirement for performance and the application requires lots of space.
Using PSRAM
++++++++++++++++++++++++++++
.. only:: esp32c3
PSRAM is generally used when the application takes up a lot of memory. In this mode, the :ref:`CONFIG_ESP32_WIFI_TX_BUFFER` is forced to be static. :ref:`CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM` indicates the number of DMA buffers at the hardware layer, increase this parameter can improve performance.
The following are the recommended ranks for using PSRAM:
**Ranks:**
- **Iperf rank**
{IDF_TARGET_NAME} extreme performance rank used to test extreme performance.
- **Default rank**
{IDF_TARGET_NAME}'s default configuration rank, the available memory, and performance are in balance.
- **Minimum rank**
This is the minimum configuration rank of {IDF_TARGET_NAME}. The protocol stack only uses the necessary memory for running. It is suitable for scenarios that have no requirement for performance and the application requires lots of space.
.. only:: esp32 or esp32s2
Using PSRAM
++++++++++++++++++++++++++++
PSRAM is generally used when the application takes up a lot of memory. In this mode, the :ref:`CONFIG_ESP32_WIFI_TX_BUFFER` is forced to be static. :ref:`CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM` indicates the number of DMA buffers at the hardware layer, increase this parameter can improve performance.
The following are the recommended ranks for using PSRAM:
.. only:: esp32

View File

@ -32,24 +32,24 @@
Wi-Fi 初始化
+++++++++++++++
请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_`[IDF_TARGET_NAME] Wi-Fi AP 一般情况`_。
请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_`{IDF_TARGET_NAME} Wi-Fi AP 一般情况`_。
启动/连接 Wi-Fi
++++++++++++++++++++
请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_`[IDF_TARGET_NAME] Wi-Fi AP 一般情况`_。
请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_`{IDF_TARGET_NAME} Wi-Fi AP 一般情况`_。
事件处理
++++++++++++++
通常,在晴好环境下编写代码难度并不大,如 `WIFI_EVENT_STA_START`_、`WIFI_EVENT_STA_CONNECTED`_ 中所述。难度在于如何在阴翳的困难环境下编写代码,如 `WIFI_EVENT_STA_DISCONNECTED`_ 中所述。能否在后者情况下完美地解决各类事件冲突,是编写一个强健的 Wi-Fi 应用程序的根本。请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_、`[IDF_TARGET_NAME] Wi-Fi AP 一般情况`_。另可参阅 ESP-IDF 中的事件处理概述 `Event Handling <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/event-handling.html?highlight=event%20handling>`_
通常,在晴好环境下编写代码难度并不大,如 `WIFI_EVENT_STA_START`_、`WIFI_EVENT_STA_CONNECTED`_ 中所述。难度在于如何在阴翳的困难环境下编写代码,如 `WIFI_EVENT_STA_DISCONNECTED`_ 中所述。能否在后者情况下完美地解决各类事件冲突,是编写一个强健的 Wi-Fi 应用程序的根本。请参阅 `{IDF_TARGET_NAME} Wi-Fi station 一般情况`_、`{IDF_TARGET_NAME} Wi-Fi AP 一般情况`_。另可参阅 ESP-IDF 中的事件处理概述 `Event Handling <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/event-handling.html?highlight=event%20handling>`_
编写错误恢复程序
++++++++++++++++++++++++++++++++++++++++++++++++++++
除了在能在比较差的环境下工作,错误恢复能力也对一个强健的 Wi-Fi 应用程序至关重要。请参阅 `[IDF_TARGET_NAME] Wi-Fi API 错误代码`_。
除了在能在比较差的环境下工作,错误恢复能力也对一个强健的 Wi-Fi 应用程序至关重要。请参阅 `{IDF_TARGET_NAME} Wi-Fi API 错误代码`_。
[IDF_TARGET_NAME] Wi-Fi API 错误代码
{IDF_TARGET_NAME} Wi-Fi API 错误代码
--------------------------------------
所有 [IDF_TARGET_NAME] Wi-Fi API 都有定义好的返回值,即错误代码。这些错误代码可分类为:
所有 {IDF_TARGET_NAME} Wi-Fi API 都有定义好的返回值,即错误代码。这些错误代码可分类为:
- 无错误,例如:返回值 ESP_OK 代表 API 成功返回
- 可恢复错误例如ESP_ERR_NO_MEM
@ -66,7 +66,7 @@ Wi-Fi 初始化
在 esp_err.h 中ESP_ERROR_CHECK 负责检查返回值。这是一个较为常见的错误处理代码,可在应用程序开发阶段作为默认的错误处理代码。但是,我们强烈建议 API 的使用者自己编写错误处理代码。
初始化 [IDF_TARGET_NAME] Wi-Fi API 参数
初始化 {IDF_TARGET_NAME} Wi-Fi API 参数
----------------------------------------------------
初始化 API 的结构参数时,应遵循以下两种方式之一:
@ -78,9 +78,9 @@ Wi-Fi 初始化
.. _wifi-programming-model:
[IDF_TARGET_NAME] Wi-Fi 编程模型
{IDF_TARGET_NAME} Wi-Fi 编程模型
-----------------------------------------
[IDF_TARGET_NAME] Wi-Fi 编程模型如下图所示:
{IDF_TARGET_NAME} Wi-Fi 编程模型如下图所示:
.. blockdiag::
:caption: Wi-Fi 编程模型
@ -364,7 +364,7 @@ Wi-Fi 驱动程序初始化成功后,可以进入到配置阶段。该场景
- s8.3:调用函数 :cpp:func:`esp_wifi_deinit()` 清理 Wi-Fi 驱动程序。
[IDF_TARGET_NAME] Wi-Fi AP 一般情况
{IDF_TARGET_NAME} Wi-Fi AP 一般情况
---------------------------------------------
下图为 AP 模式下的宏观场景,其中包含不同阶段的具体描述:
@ -1151,7 +1151,7 @@ LR 兼容性
根据上表,得出以下结论:
- 对于已使能 LR 的 {IDF_TARGET_NAME} AP由于不是以 LR 模式发送 beacon因此与传统的 802.11 模式不兼容。
- 对于已使能 LR 且并非仅 LR 模式的 [IDF_TARGET_NAME] station与传统 802.11 模式兼容。
- 对于已使能 LR 且并非仅 LR 模式的 {IDF_TARGET_NAME} station与传统 802.11 模式兼容。
- 如果 station 和 AP 都是 {IDF_TARGET_NAME} 设备,并且两者都使能 LR 模式,则协商的模式支持 LR。
如果协商的 Wi-Fi 模式同时支持传统的 802.11 模式和 LR 模式,则 Wi-Fi 驱动程序会在不同的 Wi-Fi 模式下自动选择最佳数据速率,应用程序无需任何操作。
@ -1327,23 +1327,65 @@ AP 睡眠
下表是我们在 Espressif 实验室和屏蔽箱中获得的最佳吞吐量结果。
+----------------------------+----------------+------------+---------------+----------------------+
| 类型/吞吐量 | 实验室空气状况 | 屏蔽箱 | 测试工具 | IDF 版本 (commit ID) |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包接收数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包发送数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 接收数据 | 30 MBit/s | 90 MBit/s | iperf example | 05838641 |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 发送数据 | 30 MBit/s | 60 MBit/s | iperf example | 05838641 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 接收数据 | 20 MBit/s | 50 MBit/s | iperf example | 05838641 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 发送数据 | 20 MBit/s | 50 MBit/s | iperf example | 05838641 |
+----------------------------+----------------+------------+---------------+----------------------+
.. only:: esp32
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:` 示例/wifi/iperf/sdkconfig.ci.99`
+----------------------------+----------------+------------+---------------+----------------------+
| 类型/吞吐量 | 实验室空气状况 | 屏蔽箱 | 测试工具 | IDF 版本 (commit ID) |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包接收数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包发送数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 接收数据 | 30 MBit/s | 85 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 发送数据 | 30 MBit/s | 75 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 接收数据 | 20 MBit/s | 65 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 发送数据 | 20 MBit/s | 75 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:` 示例/wifi/iperf/sdkconfig.defaults.esp32`
.. only:: esp32s2
+----------------------------+----------------+------------+---------------+----------------------+
| 类型/吞吐量 | 实验室空气状况 | 屏蔽箱 | 测试工具 | IDF 版本 (commit ID) |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包接收数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包发送数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 接收数据 | 30 MBit/s | 70 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 发送数据 | 30 MBit/s | 50 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 接收数据 | 20 MBit/s | 32 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 发送数据 | 20 MBit/s | 37 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:` 示例/wifi/iperf/sdkconfig.defaults.esp32s2`
.. only:: esp32c3
+----------------------------+----------------+------------+---------------+----------------------+
| 类型/吞吐量 | 实验室空气状况 | 屏蔽箱 | 测试工具 | IDF 版本 (commit ID) |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包接收数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| 原始 802.11 数据包发送数据 | N/A | 130 MBit/s | 内部工具 | N/A |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 接收数据 | 30 MBit/s | 50 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| UDP 发送数据 | 30 MBit/s | 40 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 接收数据 | 20 MBit/s | 35 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
| TCP 发送数据 | 20 MBit/s | 37 MBit/s | iperf example | 15575346 |
+----------------------------+----------------+------------+---------------+----------------------+
使用 iperf example 测试吞吐量时sdkconfig 是 :idf_file:` 示例/wifi/iperf/sdkconfig.defaults.esp32c3`
Wi-Fi 80211 数据包发送
---------------------------
@ -1613,12 +1655,18 @@ Wi-Fi 协议中定义了四个 AC (访问类别),每个 AC 有各自的优
Wi-Fi AMSDU
-------------------------
{IDF_TARGET_NAME} 支持接收 AMSDU但不支持发送 AMSDU。因为 {IDF_TARGET_NAME} 已发送 AMPDU因此无需发送 AMSDU。
{IDF_TARGET_NAME} 支持接收发送 AMSDU。
Wi-Fi 分片
-------------------------
[IDF_TARGET_NAME] 支持 Wi-Fi 接收分片,但不支持 Wi-Fi 发送分片。未来的版本将支持 Wi-Fi 传输分片。
.. only:: esp32 or esp32s2
支持 Wi-Fi 接收分片,但不支持 Wi-Fi 发送分片。
.. only:: esp32c3
ESP32C3 支持 Wi-Fi 接收和发送分片。
WPS 注册
-------------------------
@ -1725,11 +1773,13 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
**通过在 IRAM 中放置代码优化吞吐量:**
- :ref:`CONFIG_ESP32_WIFI_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 15 kB。
.. only:: esp32 or esp32s2
- :ref:`CONFIG_ESP32_WIFI_RX_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 接收数据功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 16 kB。
- :ref:`CONFIG_ESP32_WIFI_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 15 kB。
- :ref:`CONFIG_ESP32_WIFI_RX_IRAM_OPT`
如果使能该选项,一些 Wi-Fi 接收数据功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 16 kB。
- :ref:`CONFIG_LWIP_IRAM_OPTIMIZATION`
如果使能该选项,一些 LWIP 功能将被移至 IRAM从而提高吞吐量IRAM 使用量将增加 13 kB。
@ -1829,6 +1879,36 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
| UDP 接收数据吞吐量 | 78.1 | 66.7 | 65.3 | 53.8 | 28.5 |
+----------------------------+-------+--------+------+----------+-------+
.. only:: esp32c3
+----------------------------+-------+---------+---------+
| 等级 | Iperf | 默认 | 最小 |
+============================+=======+=========+=========+
| 可用内存(KB) | 59 | 160 | 180 |
+----------------------------+-------+---------+---------+
| WIFI_STATIC_RX_BUFFER_NUM | 20 | 8 | 3 |
+----------------------------+-------+---------+---------+
| WIFI_DYNAMIC_RX_BUFFER_NUM | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| WIFI_DYNAMIC_TX_BUFFER_NUM | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| WIFI_RX_BA_WIN | 32 | 16 | 6 |
+----------------------------+-------+---------+---------+
| TCP_SND_BUF_DEFAULT(KB) | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| TCP_WND_DEFAULT(KB) | 40 | 16 | 6 |
+----------------------------+-------+---------+---------+
| LWIP_IRAM_OPTIMIZATION | 13 | 13 | 0 |
+----------------------------+-------+---------+---------+
| TCP 发送数据吞吐量 | 38.1 | 27.2 | 20.4 |
+----------------------------+-------+---------+---------+
| TCP 接收数据吞吐量 | 35.3 | 24.2 | 17.4 |
+----------------------------+-------+---------+---------+
| UDP 发送数据吞吐量 | 40.6 | 38.9 | 34.1 |
+----------------------------+-------+---------+---------+
| UDP 接收数据吞吐量 | 52.4 | 44.5 | 44.2 |
+----------------------------+-------+---------+---------+
.. note::
以上结果由使用华硕RT-N66U路由器在屏蔽箱中进行单流测试得出。{IDF_TARGET_NAME} 的 CPU 为双核,频率为 240 MHzflash 为 QIO 模式,频率为 80 MHz。
@ -1871,11 +1951,26 @@ Wi-Fi 使用的堆内存峰值是 Wi-Fi 驱动程序 **理论上消耗的最大
- **最小等级**
{IDF_TARGET_NAME} 的最小配置等级。协议栈只使用运行所需的内存。适用于对性能没有要求,而应用程序需要大量内存的场景。
使用 PSRAM
++++++++++++++++++++++++++++
.. only:: esp32c3
PSRAM 一般在应用程序占用大量内存时使用。在该模式下,:ref:`CONFIG_ESP32_WIFI_TX_BUFFER` 被强制为静态。:ref:`CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM` 表示硬件层 DMA 缓冲区数量,提高这一参数可以增强性能。
我们推荐以下 PSRAM 等级。
**等级:**
- **Iperf 等级**
{IDF_TARGET_NAME} 极端性能等级,用于测试极端性能。
- **默认等级**
IDF_TARGET_NAME} 的默认配置等级、兼顾可用内存和性能。
- **最小等级**
{IDF_TARGET_NAME} 的最小配置等级。协议栈只使用运行所需的内存。适用于对性能没有要求,而应用程序需要大量内存的场景。
.. only:: esp32 or esp32s2
使用 PSRAM
++++++++++++++++++++++++++++
PSRAM 一般在应用程序占用大量内存时使用。在该模式下,:ref:`CONFIG_ESP32_WIFI_TX_BUFFER` 被强制为静态。:ref:`CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM` 表示硬件层 DMA 缓冲区数量,提高这一参数可以增强性能。
我们推荐以下 PSRAM 等级。
.. only:: esp32

View File

@ -0,0 +1,22 @@
#
# ESP32C3
#
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=20
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP32_WIFI_TX_BA_WIN=32
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=32
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=40960
CONFIG_LWIP_TCP_WND_DEFAULT=40960
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y
CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y