mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
docs: Sync CN and EN docs
This commit is contained in:
parent
4cb0c09a38
commit
8eff8b088e
@ -474,7 +474,7 @@ The number of IP addresses returned by network database APIs such as ``getaddrin
|
||||
|
||||
In the implementation of ``getaddrinfo()``, the canonical name is not available. Therefore, the ``ai_canonname`` field of the first returned ``addrinfo`` structure will always refer to the ``nodename`` argument or a string with the same contents.
|
||||
|
||||
The ``getaddrinfo()`` system call in lwIP within ESP-IDF has a limitation when using ``AF_UNSPEC``, as it defaults to returning only an IPv4 address in dual stack mode. This can cause issues in IPv6-only networks. To handle this, a workaround involves making two sequential calls to ``getaddrinfo()``: the first with AF_INET to query for IPv4 addresses, and the second with AF_INET6 to retrieve IPv6 addresses. To address this, the custom ``esp_getaddrinfo()`` function has been added to the lwIP port layer to handle both IPv4 and IPv6 addresses when AF_UNSPEC is used. The :ref:`CONFIG_LWIP_USE_ESP_GETADDRINFO` option, available when both IPv4 and IPv6 are enabled, controls whether ``esp_getaddrinfo()`` or the default lwIP implementation is used. It is disabled by default.
|
||||
The ``getaddrinfo()`` system call in lwIP within ESP-IDF has a limitation when using ``AF_UNSPEC``, as it defaults to returning only an IPv4 address in dual stack mode. This can cause issues in IPv6-only networks. To handle this, a workaround involves making two sequential calls to ``getaddrinfo()``: the first with ``AF_INET`` to query for IPv4 addresses, and the second with ``AF_INET6`` to retrieve IPv6 addresses. To provide a more robust solution, the custom ``esp_getaddrinfo()`` function has been added to the lwIP port layer to handle both IPv4 and IPv6 addresses when ``AF_UNSPEC`` is used. The :ref:`CONFIG_LWIP_USE_ESP_GETADDRINFO` option, available when both IPv4 and IPv6 are enabled, controls whether ``esp_getaddrinfo()`` or ``getaddrinfo()`` is used. It is disabled by default.
|
||||
|
||||
Calling ``send()`` or ``sendto()`` repeatedly on a UDP socket may eventually fail with ``errno`` equal to ``ENOMEM``. This failure occurs due to the limitations of buffer sizes in the lower-layer network interface drivers. If all driver transmit buffers are full, the UDP transmission will fail. For applications that transmit a high volume of UDP datagrams and aim to avoid any dropped datagrams by the sender, it is advisable to implement error code checking and employ a retransmission mechanism with a short delay.
|
||||
|
||||
|
@ -115,8 +115,7 @@ In the OpenThread protocol stack, defining macros to enable features and configu
|
||||
|
||||
.. note::
|
||||
|
||||
The priority of the above configuration methods, from highest to lowest, is as follows:
|
||||
Configuration Menu → User-defined Header File → openthread-core-esp32x-xxx-config.h → OpenThread Stack Default Configuration
|
||||
The priority of the above configuration methods, from highest to lowest, is as follows: Configuration Menu → User-defined Header File → openthread-core-esp32x-xxx-config.h → OpenThread Stack Default Configuration
|
||||
|
||||
The OpenThread Border Router
|
||||
----------------------------
|
||||
|
@ -54,7 +54,7 @@ Here is the summary printed for the "Factory app, two OTA definitions" configura
|
||||
Creating Custom Tables
|
||||
----------------------
|
||||
|
||||
If you choose "Custom partition table CSV" in menuconfig then you can also enter the name of a CSV file (in the project directory) to use for your partition table. The CSV file can describe any number of definitions for the table you need.
|
||||
If you choose "Custom partition table CSV" in ``menuconfig``, then you can also enter the name of a CSV file (in the project directory) to use for your partition table. The CSV file can describe any number of definitions for the table you need.
|
||||
|
||||
The CSV format is the same format as printed in the summaries shown above. However, not all fields are required in the CSV. For example, here is the "input" CSV for the OTA partition table:
|
||||
|
||||
@ -135,18 +135,18 @@ See enum :cpp:type:`esp_partition_subtype_t` for the full list of subtypes defin
|
||||
|
||||
* When type is ``bootloader``, the SubType field can be specified as:
|
||||
|
||||
- ``primary`` (0x00). This is the 2nd stage bootloader, located at the {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH} address in flash memory. The tool automatically determines the appropriate size and offset for this subtype, so any size or offset specified for this subtype will be ignored. You can either leave these fields blank or use ``N/A`` as a placeholder.
|
||||
- ``ota`` (0x01). This is a temporary bootloader partition used by the bootloader OTA update functionality to download a new image. The tool ignores the size for this subtype, allowing you to leave it blank or use ``N/A``. You can only specify an offset, or leave it blank to have the tool calculate it based on the offsets of previously used partitions.
|
||||
- ``recovery`` (0x02). This is the recovery bootloader partition used for safely performing OTA updates to the bootloader. The ``gen_esp32part.py`` tool automatically determines the address and size for this partition, so you can leave these fields blank or use ``N/A`` as a placeholder. The address must match an eFuse field, which is defined through a Kconfig option. If the normal bootloader loading path fails, the ROM bootloader will attempt to load the recovery partition at the address specified by the eFuse field.
|
||||
- ``primary`` (0x00). This is the 2nd stage bootloader, located at the {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH} address in flash memory. The tool automatically determines the appropriate size and offset for this subtype, so any size or offset specified for this subtype will be ignored. You can either leave these fields blank or use ``N/A`` as a placeholder.
|
||||
- ``ota`` (0x01). This is a temporary bootloader partition used by the bootloader OTA update functionality to download a new image. The tool ignores the size for this subtype, allowing you to leave it blank or use ``N/A``. You can only specify an offset, or leave it blank to have the tool calculate it based on the offsets of previously used partitions.
|
||||
- ``recovery`` (0x02). This is the recovery bootloader partition used for safely performing OTA updates to the bootloader. The ``gen_esp32part.py`` tool automatically determines the address and size for this partition, so you can leave these fields blank or use ``N/A`` as a placeholder. The address must match an eFuse field, which is defined through a Kconfig option. If the normal bootloader loading path fails, the first stage (ROM) bootloader will attempt to load the recovery partition at the address specified by the eFuse field.
|
||||
|
||||
The size of the bootloader type is calculated by the ``gen_esp32part.py`` tool based on the specified ``--offset`` (the partition table offset) and ``--primary-partition-offset`` arguments. Specifically, the bootloader size is defined as (:ref:`CONFIG_PARTITION_TABLE_OFFSET` - {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH}). This calculated size applies to all subtypes of the bootloader.
|
||||
The size of the bootloader type is calculated by the ``gen_esp32part.py`` tool based on the specified ``--offset`` (the partition table offset) and ``--primary-partition-offset`` arguments. Specifically, the bootloader size is defined as (:ref:`CONFIG_PARTITION_TABLE_OFFSET` - {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH}). This calculated size applies to all subtypes of the bootloader.
|
||||
|
||||
* When type is ``partition_table``, the SubType field can be specified as:
|
||||
|
||||
- ``primary`` (0x00). This is the primary partition table, located at the :ref:`CONFIG_PARTITION_TABLE_OFFSET` address in flash memory. The tool automatically determines the appropriate size and offset for this subtype, so any size or offset specified for this subtype will be ignored. You can either leave these fields blank or use ``N/A`` as a placeholder.
|
||||
- ``ota`` (0x01). It is a temporary partition table partition used by the partition table OTA update functionality for downloading a new image. The tool ignores the size for this subtype, allowing you to leave it blank or use ``N/A``. You can specify an offset, or leave it blank, in which case the tool will calculate it based on the offsets of previously allocated partitions.
|
||||
- ``primary`` (0x00). This is the primary partition table, located at the :ref:`CONFIG_PARTITION_TABLE_OFFSET` address in flash memory. The tool automatically determines the appropriate size and offset for this subtype, so any size or offset specified for this subtype will be ignored. You can either leave these fields blank or use ``N/A`` as a placeholder.
|
||||
- ``ota`` (0x01). It is a temporary partition table partition used by the partition table OTA update functionality for downloading a new image. The tool ignores the size for this subtype, allowing you to leave it blank or use ``N/A``. You can specify an offset, or leave it blank, in which case the tool will calculate it based on the offsets of previously allocated partitions.
|
||||
|
||||
The size for the ``partition_table`` type is fixed at ``0x1000`` and applies uniformly across all subtypes of ``partition_table``.
|
||||
The size for the ``partition_table`` type is fixed at ``0x1000`` and applies uniformly across all subtypes of ``partition_table``.
|
||||
|
||||
* When type is ``data``, the subtype field can be specified as ``ota`` (0x00), ``phy`` (0x01), ``nvs`` (0x02), nvs_keys (0x04), or a range of other component-specific subtypes (see :cpp:type:`subtype enum <esp_partition_subtype_t>`).
|
||||
|
||||
@ -220,15 +220,15 @@ Two flags are currently supported, ``encrypted`` and ``readonly``:
|
||||
|
||||
.. note::
|
||||
|
||||
The following type partitions will always be encrypted, regardless of whether this flag is set or not:
|
||||
The following type partitions will always be encrypted, regardless of whether this flag is set or not:
|
||||
|
||||
.. list::
|
||||
.. list::
|
||||
|
||||
- ``app``,
|
||||
- ``bootloader``,
|
||||
- ``partition_table``,
|
||||
- type ``data`` and subtype ``ota``,
|
||||
- type ``data`` and subtype ``nvs_keys``.
|
||||
- ``app``,
|
||||
- ``bootloader``,
|
||||
- ``partition_table``,
|
||||
- type ``data`` and subtype ``ota``,
|
||||
- type ``data`` and subtype ``nvs_keys``.
|
||||
|
||||
- If ``readonly`` flag is set, the partition will be read-only. This flag is only supported for ``data`` type partitions except ``ota`` and ``coredump`` subtypes. This flag can help to protect against accidental writes to a partition that contains critical device-specific configuration data, e.g., factory data partition.
|
||||
|
||||
|
@ -67,7 +67,7 @@ The map file itself is broken into parts and each part has a heading. The parts
|
||||
|
||||
.. note::
|
||||
|
||||
Linker map files are generated by the GNU binutils linker ``ld``, not ESP-IDF. You can find additional information online about the linker map file format. This quick summary is written from the perspective of ESP-IDF build system in particular.
|
||||
Linker map files are generated by the GNU binutils linker ``ld``, not ESP-IDF. You can find additional information online about the linker map file format. This quick summary is written from the perspective of ESP-IDF build system in particular.
|
||||
|
||||
.. _reducing-overall-size:
|
||||
|
||||
@ -94,7 +94,7 @@ The following configuration options reduces the final binary size of almost any
|
||||
|
||||
.. note::
|
||||
|
||||
In addition to the many configuration items shown here, there are a number of configuration options where changing the option from the default increases binary size. These are not noted here. Where the increase is significant is usually noted in the configuration item help text.
|
||||
In addition to the many configuration items shown here, there are a number of configuration options where changing the option from the default increases binary size. These are not noted here. Where the increase is significant is usually noted in the configuration item help text.
|
||||
|
||||
.. _size-targeted-optimizations:
|
||||
|
||||
@ -147,9 +147,9 @@ lwIP IPv4
|
||||
|
||||
- If IPv4 connectivity is not required, setting :ref:`CONFIG_LWIP_IPV4` to ``false`` will reduce the size of the lwIP, supporting IPv6-only TCP/IP stack.
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
|
||||
Before disabling IPv4 support, please note that IPv6 only network environments are not ubiquitous and must be supported in the local network, e.g., by your internet service provider or using constrained local network settings.
|
||||
Before disabling IPv4 support, please note that IPv6 only network environments are not ubiquitous and must be supported in the local network, e.g., by your internet service provider or using constrained local network settings.
|
||||
|
||||
.. _newlib-nano-formatting:
|
||||
|
||||
@ -213,21 +213,22 @@ The help text for each option has some more information for reference.
|
||||
|
||||
.. important::
|
||||
|
||||
It is **strongly not recommended to disable all these mbedTLS options**. Only disable options of which you understand the functionality and are certain that it is not needed in the application. In particular:
|
||||
It is **strongly not recommended to disable all these mbedTLS options**. Only disable options of which you understand the functionality and are certain that it is not needed in the application. In particular:
|
||||
|
||||
- Ensure that any TLS server(s) the device connects to can still be used. If the server is controlled by a third party or a cloud service, it is recommended to ensure that the firmware supports at least two of the supported cipher suites in case one is disabled in a future update.
|
||||
- Ensure that any TLS client(s) that connect to the device can still connect with supported/recommended cipher suites. Note that future versions of client operating systems may remove support for some features, so it is recommended to enable multiple supported cipher suites, or algorithms for redundancy.
|
||||
- Ensure that any TLS server(s) the device connects to can still be used. If the server is controlled by a third party or a cloud service, it is recommended to ensure that the firmware supports at least two of the supported cipher suites in case one is disabled in a future update.
|
||||
- Ensure that any TLS client(s) that connect to the device can still connect with supported/recommended cipher suites. Note that future versions of client operating systems may remove support for some features, so it is recommended to enable multiple supported cipher suites, or algorithms for redundancy.
|
||||
|
||||
If depending on third party clients or servers, always pay attention to announcements about future changes to supported TLS features. If not, the {IDF_TARGET_NAME} device may become inaccessible if support changes.
|
||||
If depending on third party clients or servers, always pay attention to announcements about future changes to supported TLS features. If not, the {IDF_TARGET_NAME} device may become inaccessible if support changes.
|
||||
|
||||
.. only:: CONFIG_ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB
|
||||
|
||||
Enabling the config option :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` will use the crypto algorithms from mbedTLS library inside the chip ROM.
|
||||
Disabling the config option :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` will use the crypto algorithms from the ESP-IDF mbedtls component library. This will increase the binary size (flash footprint).
|
||||
Enabling the config option :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` will use the crypto algorithms from mbedTLS library inside the chip ROM.
|
||||
|
||||
Disabling the config option :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` will use the crypto algorithms from the ESP-IDF mbedtls component library. This will increase the binary size (flash footprint).
|
||||
|
||||
.. note::
|
||||
|
||||
Not every combination of mbedTLS compile-time config is tested in ESP-IDF. If you find a combination that fails to compile or function as expected, please report the details on `GitHub <https://github.com/espressif/esp-idf>`_.
|
||||
Not every combination of mbedTLS compile-time config is tested in ESP-IDF. If you find a combination that fails to compile or function as expected, please report the details on `GitHub <https://github.com/espressif/esp-idf>`_.
|
||||
|
||||
VFS
|
||||
@@@
|
||||
@ -253,6 +254,7 @@ VFS
|
||||
@@@@
|
||||
|
||||
.. list::
|
||||
|
||||
* Enabling :ref:`CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH` can reduce the IRAM usage and binary size by placing the entirety of the heap functionalities in flash memory.
|
||||
:CONFIG_ESP_ROM_HAS_HEAP_TLSF: * Enabling :ref:`CONFIG_HEAP_TLSF_USE_ROM_IMPL` can reduce the IRAM usage and binary size by linking in the TLSF library of ROM implementation.
|
||||
|
||||
@ -267,10 +269,10 @@ VFS
|
||||
1. Disable the secondary console by setting :ref:`CONFIG_ESP_CONSOLE_SECONDARY` to ``CONFIG_ESP_CONSOLE_SECONDARY_NONE``.
|
||||
2. Set :ref:`CONFIG_ESP_CONSOLE_UART` to use one of the following:
|
||||
|
||||
* ``UART`` reduces the binary size by around 2.5 KB.
|
||||
* ``USB-Serial-JTAG`` reduces the binary size by around 10 KB and DRAM usage by around 1.5 KB.
|
||||
* ``UART`` reduces the binary size by around 2.5 KB.
|
||||
* ``USB-Serial-JTAG`` reduces the binary size by around 10 KB and DRAM usage by around 1.5 KB.
|
||||
|
||||
Please note that these size reductions assume the UART/USB-Serial-JTAG driver code is not pulled into the app, if you already use these drivers for other purposes then the savings will be smaller.
|
||||
Please note that these size reductions assume the UART/USB-Serial-JTAG driver code is not pulled into the app. If these drivers are already used for other purposes, then the savings will be smaller.
|
||||
|
||||
|
||||
Bootloader Size
|
||||
|
@ -654,7 +654,6 @@ LED 特征数据的访问通过 `led_chr_access` 回调函数管理,相关代
|
||||
|
||||
简单总结一下,当 GATT 客户端订阅心率测量值时, `gap_event_handler` 将会接收到订阅事件,并将订阅事件传递至 `gatt_svr_subscribe_cb` 回调函数,随后更新心率测量值的订阅状态。在 `heart_rate_task` 线程中,每秒都会检查一次心率测量值的订阅状态,若订阅状态为真,则将心率测量值发送至客户端。
|
||||
|
||||
|
||||
总结
|
||||
----------------------------
|
||||
|
||||
|
@ -474,6 +474,8 @@ NAPT 和端口转发
|
||||
|
||||
在调用 ``getaddrinfo()`` 函数时,不会返回规范名称。因此,第一个返回的 ``addrinfo`` 结构中的 ``ai_canonname`` 字段仅包含 ``nodename`` 参数或相同内容的字符串。
|
||||
|
||||
ESP-IDF 中 lwIP 的 ``getaddrinfo()`` 系统调用在使用 ``AF_UNSPEC`` 时存在限制:双栈模式下默认只返回 IPv4 地址,因此在仅支持 IPv6 的网络中可能会出现问题。为了解决这个问题,可以通过以下方法进行处理:分别调用两次 ``getaddrinfo()``,第一次使用 ``AF_INET`` 查询 IPv4 地址,第二次使用 ``AF_INET6`` 查询 IPv6 地址。为了进一步优化,lwIP 移植层中新增了自定义函数 ``esp_getaddrinfo()``,该函数在使用 ``AF_UNSPEC`` 时能够同时处理 IPv4 和 IPv6 地址。同时启用 IPv4 和 IPv6 后,可通过 :ref:`CONFIG_LWIP_USE_ESP_GETADDRINFO` 选项选择使用自定义的 ``esp_getaddrinfo()`` 或默认的 ``getaddrinfo()`` 实现。``esp_getaddrinfo()`` 默认处于禁用状态。
|
||||
|
||||
在 UDP 套接字上重复调用 ``send()`` 或 ``sendto()`` 最终可能会导致错误。此时 ``errno`` 报错为 ``ENOMEM``,错误原因是底层网络接口驱动程序中的 buffer 大小有限。当所有驱动程序的传输 buffer 已满时,UDP 传输事务失败。如果应用程序需要发送大量 UDP 数据报,且不希望发送方丢弃数据报,建议检查错误代码,采用短延迟的重传机制。
|
||||
|
||||
.. only:: esp32
|
||||
|
@ -113,7 +113,7 @@ OpenThread 宏定义
|
||||
- 使用 ``openthread-core-esp32x-xxx-config.h`` 的配置:部分宏在 OpenThread private 头文件中已经设置默认值,暂不支持通过 menuconfig 修改,但可以通过用户自定义头文件修改。
|
||||
- 使用 OpenThread 协议栈默认配置:对于其他宏,OpenThread 协议栈在定义时已设置默认值。
|
||||
|
||||
.. 注意::
|
||||
.. note::
|
||||
|
||||
以上四种配置方式,优先级由高到低为:配置菜单 → 用户自定义头文件 → openthread-core-esp32x-xxx-config.h → OpenThread 协议栈默认配置
|
||||
|
||||
|
@ -84,6 +84,7 @@ CSV 文件的格式与上面摘要中打印的格式相同,但是在 CSV 文
|
||||
nvs, data, nvs, , 0x6000,
|
||||
phy_init, data, phy, , 0x1000,
|
||||
factory, app, factory, , 1M,
|
||||
recoveryBloader, bootloader, recovery, N/A, N/A,
|
||||
|
||||
``gen_esp32part.py`` 工具将根据所选的 Kconfig 选项将每个 ``N/A`` 替换为适当的值:引导加载程序的偏移地址为 {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH},分区表的偏移地址见 :ref:`CONFIG_PARTITION_TABLE_OFFSET`。
|
||||
|
||||
@ -136,8 +137,9 @@ SubType 字段长度为 8 bit,内容与具体分区 Type 有关。目前,ESP
|
||||
|
||||
- ``primary`` (0x00),即二级引导加载程序,位于 flash 的 {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH} 地址处。工具会自动确定此子类型的适当大小和偏移量,因此为此子类型指定的任何大小或偏移量将被忽略。你可以将这些字段留空或使用 ``N/A`` 作为占位符。
|
||||
- ``ota`` (0x01),是一个临时的引导加载程序分区,在 OTA 更新期间可用于下载新的引导加载程序镜像。工具会忽略此子类型的大小,你可以将其留空或使用 ``N/A``。你只能指定一个偏移量,或者将其留空,工具将根据先前使用的分区的偏移量进行计算。
|
||||
- ``recovery`` (0x02),这是用于安全执行引导加载程序 OTA 更新的恢复引导加载程序分区。``gen_esp32part.py`` 工具会自动确定该分区的地址和大小,因此可以将这些字段留空或使用 ``N/A`` 作为占位符。该分区地址必须与 Kconfig 选项定义的 eFuse 字段相匹配。如果正常的引导加载程序加载路径失败,则一级 (ROM) 引导加载程序会尝试加载 eFuse 字段指定地址的恢复分区。
|
||||
|
||||
引导加载程序的大小由 ``gen_esp32part.py`` 工具根据指定的 ``--offset`` (分区表偏移量) 和 ``--primary-partition-offset`` 参数计算。具体而言,引导加载程序的大小定义为 (:ref:`CONFIG_PARTITION_TABLE_OFFSET` - {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH})。此计算的大小适用于引导加载程序的所有子类型。
|
||||
引导加载程序类型的大小由 ``gen_esp32part.py`` 工具根据指定的 ``--offset`` (分区表偏移量)和 ``--primary-partition-offset`` 参数计算得出。具体来说,引导加载程序的大小定义为 (:ref:`CONFIG_PARTITION_TABLE_OFFSET` - {IDF_TARGET_CONFIG_BOOTLOADER_OFFSET_IN_FLASH})。此计算得出的大小适用于引导加载程序的所有子类型。
|
||||
|
||||
* 当 Type 定义为 ``partition_table`` 时,可以将 SubType 字段指定为:
|
||||
|
||||
|
@ -67,7 +67,7 @@ ESP-IDF 构建系统会编译项目和 ESP-IDF 中所有源文件,但只有程
|
||||
|
||||
.. note::
|
||||
|
||||
链接器映射文件由 GNU binutils 的链接器 ``ld`` 而非由 ESP-IDF 生成。本快速概览专从 ESP-IDF 构建系统的角度编写而成,建议自行搜索更多关于链接器映射文件格式的信息。
|
||||
链接器映射文件由 GNU binutils 的链接器 ``ld`` 而非由 ESP-IDF 生成。本快速概览专从 ESP-IDF 构建系统的角度编写而成,建议自行搜索更多关于链接器映射文件格式的信息。
|
||||
|
||||
.. _reducing-overall-size:
|
||||
|
||||
@ -94,7 +94,7 @@ ESP-IDF 构建系统会编译项目和 ESP-IDF 中所有源文件,但只有程
|
||||
|
||||
.. note::
|
||||
|
||||
除了上述众多配置项之外,还有一些配置选项在更改为非默认设置时会增加二进制文件的大小,这些选项未在此列出。配置项的帮助文本中通常会阐明显著增加二进制文件大小的设置。
|
||||
除了上述众多配置项之外,还有一些配置选项在更改为非默认设置时会增加二进制文件的大小,这些选项未在此列出。配置项的帮助文本中通常会阐明显著增加二进制文件大小的设置。
|
||||
|
||||
.. _size-targeted-optimizations:
|
||||
|
||||
@ -147,9 +147,9 @@ lwIP IPv4
|
||||
|
||||
- 如果不需要 IPv4 连接功能,将 :ref:`CONFIG_LWIP_IPV4` 设置为 ``false`` 可以减小 lwIP 的大小,使其成为仅支持 IPv6 的 TCP/IP 堆栈。
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
|
||||
在禁用 IPv4 支持之前,请注意,仅支持 IPv6 的网络环境尚未普及,必须在本地网络中提供支持,例如,由互联网服务供应商提供支持,或使用受限制的本地网络设置。
|
||||
在禁用 IPv4 支持之前,请注意,仅支持 IPv6 的网络环境尚未普及,必须在本地网络中提供支持,例如,由互联网服务供应商提供支持,或使用受限制的本地网络设置。
|
||||
|
||||
.. _newlib-nano-formatting:
|
||||
|
||||
@ -213,21 +213,22 @@ MbedTLS 功能
|
||||
|
||||
.. important::
|
||||
|
||||
**强烈建议不要禁用所有 mbedTLS 选项。** 仅在理解功能用途,并确定在应用程序中不需要此功能时,方可禁用相应选项。请特别注意以下两点:
|
||||
**强烈建议不要禁用所有 mbedTLS 选项。** 仅在理解功能用途,并确定在应用程序中不需要此功能时,方可禁用相应选项。请特别注意以下两点:
|
||||
|
||||
- 确保设备连接的任何 TLS 服务器仍然可用。如果服务器由第三方或云服务控制,建议确保固件至少支持两种 TLS 密码套件,以防未来某次更新禁用了其中一种。
|
||||
- 确保连接设备的任何 TLS 客户端仍然可以使用支持/推荐的密码套件进行连接。请注意,未来版本的客户端操作系统可能会移除对某些功能的支持,因此建议启用多个支持的密码套件或算法以实现冗余。
|
||||
- 确保设备连接的任何 TLS 服务器仍然可用。如果服务器由第三方或云服务控制,建议确保固件至少支持两种 TLS 密码套件,以防未来某次更新禁用了其中一种。
|
||||
- 确保连接设备的任何 TLS 客户端仍然可以使用支持/推荐的密码套件进行连接。请注意,未来版本的客户端操作系统可能会移除对某些功能的支持,因此建议启用多个支持的密码套件或算法以实现冗余。
|
||||
|
||||
如果依赖于第三方客户端或服务器,请密切关注其有关支持的 TLS 功能的公告和变更。否则,当所支持功能变更时,{IDF_TARGET_NAME} 设备可能无法访问。
|
||||
如果依赖于第三方客户端或服务器,请密切关注其有关支持的 TLS 功能的公告和变更。否则,当所支持功能变更时,{IDF_TARGET_NAME} 设备可能无法访问。
|
||||
|
||||
.. only:: CONFIG_ESP_ROM_HAS_MBEDTLS_CRYPTO_LIB
|
||||
|
||||
启用配置选项 :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` 时 mbedtls 使用由 ROM 提供的加密算法。
|
||||
禁用配置选项 :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` 时mbedtls 完全使用由 ESP-IDF 中提供的加密算法。这会导致二进制文件大小增加。
|
||||
启用配置选项 :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` 时 mbedtls 使用由 ROM 提供的加密算法。
|
||||
|
||||
禁用配置选项 :ref:`CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL` 时mbedtls 完全使用由 ESP-IDF 中提供的加密算法。这会导致二进制文件大小增加。
|
||||
|
||||
.. note::
|
||||
|
||||
ESP-IDF 并未测试所有 mbedTLS 编译配置组合。如果发现某个组合无法编译或无法按预期执行,请在 `GitHub <https://github.com/espressif/esp-idf>`_ 上报告详细信息。
|
||||
ESP-IDF 并未测试所有 mbedTLS 编译配置组合。如果发现某个组合无法编译或无法按预期执行,请在 `GitHub <https://github.com/espressif/esp-idf>`_ 上报告详细信息。
|
||||
|
||||
虚拟文件系统 (VFS)
|
||||
@@@@@@@@@@@@@@@@@@@@@
|
||||
@ -253,9 +254,27 @@ MbedTLS 功能
|
||||
@@@@@@
|
||||
|
||||
.. list::
|
||||
|
||||
* 启用 :ref:`CONFIG_HEAP_TLSF_USE_ROM_IMPL` 可以将整个堆功能放置在 flash 中,从而减少 IRAM 使用和二进制文件大小。
|
||||
:CONFIG_ESP_ROM_HAS_HEAP_TLSF: * 启用 :ref:`CONFIG_HEAP_TLSF_USE_ROM_IMPL` 可以通过链接 ROM 实现的 TLSF 库来减少 IRAM 使用和二进制文件大小。
|
||||
|
||||
|
||||
.. only:: SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||
|
||||
控制台
|
||||
@@@@@@
|
||||
|
||||
对于支持 USB-Serial-JTAG 的目标芯片,默认情况下会同时启用 USB-Serial-JTAG 和 UART 控制台输出。如果只需要使用单个控制台,可以通过以下操作减少二进制文件大小和 RAM 使用量:
|
||||
|
||||
1. 禁用次要控制台:将 :ref:`CONFIG_ESP_CONSOLE_SECONDARY` 设置为 ``CONFIG_ESP_CONSOLE_SECONDARY_NONE``。
|
||||
2. 将 :ref:`CONFIG_ESP_CONSOLE_UART` 设置为以下选项之一:
|
||||
|
||||
* ``UART``:可减少约 2.5 KB 的二进制文件大小。
|
||||
* ``USB-Serial-JTAG``:可减少约 10 KB 的二进制文件大小和约 1.5 KB 的 DRAM 使用量。
|
||||
|
||||
请注意,以上空间节省的前提条件是 UART/USB-Serial-JTAG 驱动代码未被应用程序引用。如果因为其他用途使用了这些驱动程序,则节省效果会有所降低。
|
||||
|
||||
|
||||
引导加载程序大小
|
||||
------------------------------
|
||||
|
||||
|
@ -64,6 +64,7 @@
|
||||
|
||||
* ``magic_byte``:esp_bootloader_desc 结构体的魔术字节
|
||||
* ``reserved``:保留供 IDF 未来使用
|
||||
* ``secure_version``:引导加载程序防回滚功能使用的安全版本,请参阅:ref:`CONFIG_BOOTLOADER_ANTI_ROLLBACK_ENABLE`。
|
||||
* ``version``:引导加载程序版本,参见 :ref:`CONFIG_BOOTLOADER_PROJECT_VER`
|
||||
* ``idf_ver``:IDF 版本。[#f1]_
|
||||
* ``date`` 和 ``time``:编译日期和时间
|
||||
|
@ -8,6 +8,7 @@ Wi-Fi 扫描和连接
|
||||
------------------------
|
||||
|
||||
以下类型已被更改:
|
||||
|
||||
- :component_file:`esp_wifi/include/esp_wifi_he_types.h`
|
||||
|
||||
- :cpp:struct:`esp_wifi_htc_omc_t` 中:
|
||||
@ -19,6 +20,3 @@ Wi-Fi 扫描和连接
|
||||
- :cpp:struct:`wifi_ap_record_t` 中:
|
||||
|
||||
- ``bandwidth`` 的类型从 ``uint8_t`` 更改为 ``wifi_bandwidth_t``
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user