docs:updated CN tranlation for build-system, ulp, unit-tests, idf-monitor and linker-script-generation

This commit is contained in:
Dai Zi Yan 2021-04-22 16:08:31 +08:00 committed by Krzysztof Budzynski
parent 104830107a
commit e91861253f
10 changed files with 120 additions and 50 deletions

View File

@ -884,7 +884,6 @@ Place this line after the ``project()`` line in your project CMakeLists.txt file
For an example of using this technique, see the "main" component of the file_serving example :example_file:`protocols/http_server/file_serving/main/CMakeLists.txt` - two files are loaded at build time and linked into the firmware.
.. highlight:: cmake
It is also possible embed a generated file::

View File

@ -527,7 +527,6 @@ Note that ALIGN and SURROUND, as mentioned in the flag descriptions, are order s
KEEP(lib1.a:obj1.*( SORT(.rodata) SORT(.rodata.*) ))
_my_sym_end = ABSOLUTE(.)
.. _ldgen-symbol-granularity-placements :
On Symbol-Granularity Placements

View File

@ -267,7 +267,6 @@ Issues Observed on Windows
- Occasionally, when "idf.py" or "make" exits, it might stall for up to 30 seconds before IDF Monitor resumes.
- When "gdb" is run, it might stall for a short time before it begins communicating with the GDBStub.
.. _addr2line: https://sourceware.org/binutils/docs/binutils/addr2line.html
.. _gdb: https://sourceware.org/gdb/download/onlinedocs/
.. _pySerial: https://github.com/pyserial/pyserial

View File

@ -44,11 +44,7 @@ To compile the ULP code as part of the component, the following steps must be ta
ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}")
The first argument to ``ulp_embed_binary`` specifies the ULP binary name. The name specified here will also be used by other generated artifacts
such as the ELF file, map file, header file and linker export file. The second argument specifies the ULP assembly source files.
Finally, the third argument specifies the list of component source files which include the header file to be generated.
This list is needed to build the dependencies correctly and ensure that the generated header file will be created before any of these files are compiled.
See section below for the concept of generated header files for ULP applications.
The first argument to ``ulp_embed_binary`` specifies the ULP binary name. The name specified here will also be used by other generated artifacts such as the ELF file, map file, header file and linker export file. The second argument specifies the ULP assembly source files. Finally, the third argument specifies the list of component source files which include the header file to be generated. This list is needed to build the dependencies correctly and ensure that the generated header file will be created before any of these files are compiled. See section below for the concept of generated header files for ULP applications.
3. Build the application as usual (e.g. `idf.py app`)
@ -150,10 +146,7 @@ Declaration of the entry point symbol comes from the generated header file menti
ESP32 ULP program flow
-----------------------
ESP32 ULP coprocessor is started by a timer. The timer is started once ``ulp_run`` is called. The timer counts a number of RTC_SLOW_CLK ticks
(by default, produced by an internal 150 kHz RC oscillator). The number of ticks is set using ``SENS_ULP_CP_SLEEP_CYCx_REG`` registers (x = 0..4).
When starting the ULP for the first time, ``SENS_ULP_CP_SLEEP_CYC0_REG`` will be used to set the number of timer ticks.
Later the ULP program can select another ``SENS_ULP_CP_SLEEP_CYCx_REG`` register using ``sleep`` instruction.
ESP32 ULP coprocessor is started by a timer. The timer is started once ``ulp_run`` is called. The timer counts a number of RTC_SLOW_CLK ticks (by default, produced by an internal 150 kHz RC oscillator). The number of ticks is set using ``SENS_ULP_CP_SLEEP_CYCx_REG`` registers (x = 0..4). When starting the ULP for the first time, ``SENS_ULP_CP_SLEEP_CYC0_REG`` will be used to set the number of timer ticks. Later the ULP program can select another ``SENS_ULP_CP_SLEEP_CYCx_REG`` register using ``sleep`` instruction.
The application can set ULP timer period values (SENS_ULP_CP_SLEEP_CYCx_REG, x = 0..4) using ``ulp_set_wakeup_period`` function.
@ -171,20 +164,17 @@ Declaration of the entry point symbol comes from the generated header file menti
ESP32-S2 ULP program flow
-------------------------
ESP32-S2 ULP coprocessor is started by a timer. The timer is started once ``ulp_run`` is called. The timer counts a number of RTC_SLOW_CLK ticks
(by default, produced by an internal 90 kHz RC oscillator). The number of ticks is set using ``RTC_CNTL_ULP_CP_TIMER_1_REG`` register.
ESP32-S2 ULP coprocessor is started by a timer. The timer is started once ``ulp_run`` is called. The timer counts a number of RTC_SLOW_CLK ticks (by default, produced by an internal 90 kHz RC oscillator). The number of ticks is set using ``RTC_CNTL_ULP_CP_TIMER_1_REG`` register.
The application can set ULP timer period values by ``ulp_set_wakeup_period`` function.
.. doxygenfunction:: ulp_set_wakeup_period
Once the timer counts the number of ticks set in the selected ``RTC_CNTL_ULP_CP_TIMER_1_REG`` register, ULP coprocessor powers up and starts running the program
from the entry point set in the call to ``ulp_run``.
Once the timer counts the number of ticks set in the selected ``RTC_CNTL_ULP_CP_TIMER_1_REG`` register, ULP coprocessor powers up and starts running the program from the entry point set in the call to ``ulp_run``.
The program runs until it encounters a ``halt`` instruction or an illegal instruction. Once the program halts, ULP coprocessor powers down, and the timer is started again.
To disable the timer (effectively preventing the ULP program from running again), clear the ``RTC_CNTL_ULP_CP_SLP_TIMER_EN`` bit in the ``RTC_CNTL_STATE0_REG`` register.
This can be done both from ULP code and from the main program.
To disable the timer (effectively preventing the ULP program from running again), clear the ``RTC_CNTL_ULP_CP_SLP_TIMER_EN`` bit in the ``RTC_CNTL_STATE0_REG`` register.This can be done both from ULP code and from the main program.
.. _binutils-esp32ulp toolchain: https://github.com/espressif/binutils-esp32ulp
.. _binutils-esp32ulp toolchain: https://github.com/espressif/binutils-esp32ulp

View File

@ -118,8 +118,7 @@ Tests For Different Targets
Some tests (especially those related to hardware) cannot run on all targets. Below is a guide how to make your unit tests run on only specified targets.
1. Wrap your test code by ``!(TEMPORARY_)DISABLED_FOR_TARGETS()`` macros and place them either in the original test file, or sepeprate the code into files grouped by functions, but make sure all these files will be processed by the compiler. E.g.
::
1. Wrap your test code by ``!(TEMPORARY_)DISABLED_FOR_TARGETS()`` macros and place them either in the original test file, or sepeprate the code into files grouped by functions, but make sure all these files will be processed by the compiler. E.g.::
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32, ESP8266)
TEST_CASE("a test that is not ready for esp32 and esp8266 yet", "[]")
@ -293,4 +292,4 @@ An example cmake build command to create mocks of a component inside that compon
${MOCK_OUTPUT} contains all CMock generated output files, ${MOCK_HEADERS} contains all headers to be mocked and ${CMOCK_DIR} needs to be set to CMock directory inside IDF. ${CMAKE_COMMAND} is automatically set.
Refer to :component_file:`cmock/CMock/docs/CMock_Summary.md` for more details on how CMock works and how to create and use mocks.
Refer to :component_file:`cmock/CMock/docs/CMock_Summary.md` for more details on how CMock works and how to create and use mocks.

View File

@ -36,7 +36,7 @@ ESP-IDF 可以显式地指定和配置每个组件。在构建项目的时候,
- ``组件`` 是模块化且独立的代码,会被编译成静态库(.a 文件)并链接到应用程序。部分组件由 ESP-IDF 官方提供,其他组件则来源于其它开源项目。
- ``目标`` 特指运行构建后应用程序的硬件设备。ESP-IDF 当前仅支持 ``esp32````esp32s2`` 这两个硬件目标。
- ``目标`` 特指运行构建后应用程序的硬件设备。ESP-IDF 当前仅支持 ``esp32````esp32s2`` 以及 ``esp32c3`` 这三个硬件目标。
请注意,以下内容并不属于项目的组成部分:
@ -83,7 +83,7 @@ idf.py
对于 ``idf.py`` 不知道的指令,``idf.py`` 会尝试将其作为构建系统的目标来执行。
``idf.py`` 命令支持 bash, zsh 以及 fish shell 的 `自动补全 <https://click.palletsprojects.com/bashcomplete/>`_
``idf.py`` 命令支持 bash zsh 以及 fish shell 的 `自动补全 <https://click.palletsprojects.com/bashcomplete/>`_
要实现实现 shell `自动补全 <https://click.palletsprojects.com/bashcomplete/>`_,请先确保您安装了 Python 3.5 以及 `click <https://click.palletsprojects.com/>`_ 7.1 及以上版本(:ref:`请参考这里 <get-started-get-prerequisites>`)。
@ -216,7 +216,7 @@ ESP-IDF 适用于所有支持的 Python 版本。即使您系统中默认的 ``p
.. code-block:: none
Traceback (most recent call last):
File "/Users/user_name/e/esp-idf/tools/kconfig_new/confgen.py", line 27, in <module>
File "/Users/user_name/e/esp-idf/tools/kconfig_new/confgen.py"、 line 27、 in <module>
import kconfiglib
ImportError: bad magic number in 'kconfiglib': b'\x03\xf3\r\n'
@ -322,6 +322,26 @@ ESP-IDF 适用于所有支持的 Python 版本。即使您系统中默认的 ``p
2. 在项目 CMakeLists.txt 文件中设置 ``EXTRA_COMPONENT_DIRS``,并添加重命名后的 ``main`` 目录。
3. 在组件的 CMakeLists.txt 文件中设置 ``COMPONENT_REQUIRES````COMPONENT_PRIV_REQUIRES`` 以指定依赖项。
覆盖默认的构建规范
---------------------------------------
构建系统设置了一些全局的构建规范(编译标志、定义等),这些规范可用于编译来自所有组件的所有源文件。
.. highlight:: cmake
例如,其中一个默认的构建规范是编译选项 ``Wextra``。假设一个用户想用 ``Wno-extra`` 来覆盖这个选项,
应在 ``project()`` 之后进行::
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(myProject)
idf_build_set_property(COMPILE_OPTIONS "-Wno-error" APPEND)
这确保了用户设置的编译选项不会被默认的构建规范所覆盖,因为默认的构建规范是在 ``project()`` 内设置的。
.. _component-directories:
组件 CMakeLists 文件
@ -343,7 +363,7 @@ ESP-IDF 适用于所有支持的 Python 版本。即使您系统中默认的 ``p
同名组件
--------
ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指定的顺序依次进行,这意味着在默认情况下,首先搜索 ESP-IDF 内部组件,然后是项目组件,最后是 ``EXTRA_COMPONENT_DIRS`` 中的组件。如果这些目录中的两个或者多个包含具有相同名字的组件,则使用搜索到的最后一个位置的组件。这就允许将组件复制到项目目录中再修改以覆盖 ESP-IDF 组件如果使用这种方式ESP-IDF 目录本身可以保持不变。
ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指定的顺序依次进行,这意味着在默认情况下,首先搜索 ESP-IDF 内部组件``IDF_PATH/components``,然后是 ``EXTRA_COMPONENT_DIRS`` 中的组件,最后是项目组件(``PROJECT_DIR/components``。如果这些目录中的两个或者多个包含具有相同名字的组件,则使用搜索到的最后一个位置的组件。这就允许将组件复制到项目目录中再修改以覆盖 ESP-IDF 组件如果使用这种方式ESP-IDF 目录本身可以保持不变。
.. 注解:: 如果在现有项目中通过将组件移动到一个新位置来覆盖它,项目不会自动看到新组件的路径。请运行 ``idf.py reconfigure`` 命令后(或删除项目构建文件夹)再重新构建。
@ -362,7 +382,7 @@ ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指
- ``SRCS`` 是源文件列表(``*.c````*.cpp````*.cc````*.S``),里面所有的源文件都将会编译进组件库中。
- ``INCLUDE_DIRS`` 是目录列表,里面的路径会被添加到所有需要该组件的组件(包括 main 组件)全局 include 搜索路径中。
- ``REQUIRES`` 实际上并不是必需的,但通常需要它来声明该组件需要使用哪些其它组件,请参考 :ref:`component requirements`.
- ``REQUIRES`` 实际上并不是必需的,但通常需要它来声明该组件需要使用哪些其它组件,请参考 :ref:`component requirements`
上述命令会构建生成与组件同名的库,并最终被链接到应用程序中。
@ -370,7 +390,7 @@ ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指
还有其它参数可以传递给 ``idf_component_register``,具体可参考 :ref:`here<cmake-component-register>`
有关更完整的 ``CMakeLists.txt`` 示例,请参阅 `组件依赖示例`_ `组件 CMakeLists 示例`_
有关更完整的 ``CMakeLists.txt`` 示例,请参阅 `组件依赖示例`_`组件 CMakeLists 示例`_
创建新组件
-------------
@ -393,9 +413,9 @@ ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指
以下专用于组件的变量可以在组件 CMakeLists 中使用,但不建议修改:
- ``COMPONENT_DIR``:组件目录,即包含 ``CMakeLists.txt`` 文件的绝对路径,它与 ``CMAKE_CURRENT_SOURCE_DIR`` 变量一样,路径中不能包含空格。
- ``COMPONENT_NAME`` 组件名,与组件目录名相同。
- ``COMPONENT_ALIAS`` 库别名,由构建系统在内部为组件创建。
- ``COMPONENT_LIB`` 库名,由构建系统在内部为组件创建。
- ``COMPONENT_NAME``组件名,与组件目录名相同。
- ``COMPONENT_ALIAS``库别名,由构建系统在内部为组件创建。
- ``COMPONENT_LIB``库名,由构建系统在内部为组件创建。
以下变量在项目级别中被设置,但可在组件 CMakeLists 中使用:
@ -412,7 +432,7 @@ ESP-IDF 在搜索所有待构建的组件时,会按照 ``COMPONENT_DIRS`` 指
- ``PROJECT_DIR``:项目目录(包含项目 CMakeLists 文件)的绝对路径,与 ``CMAKE_SOURCE_DIR`` 变量相同。
- ``COMPONENTS``:此次构建中包含的所有组件的名称,具体格式为用分号隔开的 CMake 列表。
- ``IDF_VER``ESP-IDF 的 git 版本号,由 ``git describe`` 命令生成。
- ``IDF_VERSION_MAJOR``, ``IDF_VERSION_MINOR``, ``IDF_VERSION_PATCH``: ESP-IDF 的组件版本,可用于条件表达式。请注意这些信息的精确度不如 ``IDF_VER`` 变量,版本号 ``v4.0-dev-*`` ``v4.0-beta1`` ``v4.0-rc1````v4.0`` 对应的 ``IDF_VERSION_*`` 变量值是相同的,但是 ``IDF_VER`` 的值是不同的。
- ``IDF_VERSION_MAJOR````IDF_VERSION_MINOR````IDF_VERSION_PATCH``: ESP-IDF 的组件版本,可用于条件表达式。请注意这些信息的精确度不如 ``IDF_VER`` 变量,版本号 ``v4.0-dev-*`` ``v4.0-beta1`` ``v4.0-rc1````v4.0`` 对应的 ``IDF_VERSION_*`` 变量值是相同的,但是 ``IDF_VER`` 的值是不同的。
- ``IDF_TARGET``:项目的硬件目标名称。
- ``PROJECT_VER``:项目版本号。
@ -618,7 +638,7 @@ Spark Plug 组件
为避免重复性工作,各组件都用自动依赖一些“通用” IDF 组件,即使它们没有被明确提及。这些组件的头文件会一直包含在构建系统中。
通用组件包括:freertos、newlib、heap、log、soc、esp_rom、esp_common、xtensa/riscv、cxx
通用组件包括:cxx、newlib、freertos、esp_hw_support、heap、log、lwip、soc、hal、esp_rom、esp_common、esp_system
在构建中导入组件
-----------------
@ -864,7 +884,6 @@ CMake 文件可以使用 ``IDF_TARGET`` 变量来获取当前的硬件目标。
有关使用此技术的示例,请查看 file_serving 示例 :example_file:`protocols/http_server/file_serving/main/CMakeLists.txt` 中的 main 组件,两个文件会在编译时加载并链接到固件中。
.. highlight:: cmake
也可以嵌入生成的文件::
@ -1092,7 +1111,7 @@ CMake 在许多开源的 C/C++ 项目中广泛使用,用户可以在自己的
add_library(foo bar.c fizz.cpp buzz.cpp)
if(ESP_PLATFORM)
# 在 ESP-IDF 中, bar.c 需要包含 spi_flash 组件中的 esp_spi_flash.h
# 在 ESP-IDF 中 bar.c 需要包含 spi_flash 组件中的 esp_spi_flash.h
target_link_libraries(foo PRIVATE idf::spi_flash)
endif()
@ -1300,7 +1319,7 @@ idf 组件命令
``idf_component_register`` 的参数包括:
- SRCS - 组件的源文件,用于为组件创建静态库;如果没有指定,组件将被视为仅配置组件,从而创建接口库。
- SRC_DIRS, EXCLUDE_SRCS - 用于通过指定目录来 glob 源文件 (.c、.cpp、.S),而不是通过 SRCS 手动指定源文件。请注意,这受 :ref:`CMake 中通配符的限制<cmake-file-globbing>`。 在 EXCLUDE_SRCS 中指定的源文件会从被 glob 的文件中移除。
- SRC_DIRS EXCLUDE_SRCS - 用于通过指定目录来 glob 源文件 (.c、.cpp、.S),而不是通过 SRCS 手动指定源文件。请注意,这受 :ref:`CMake 中通配符的限制<cmake-file-globbing>`。 在 EXCLUDE_SRCS 中指定的源文件会从被 glob 的文件中移除。
- INCLUDE_DIRS - 相对于组件目录的路径,该路径将被添加到需要当前组件的所有其他组件的 include 搜索路径中。
- PRIV_INCLUDE_DIRS - 必须是相对于组件目录的目录路径,它仅被添加到这个组件源文件的 include 搜索路径中。
- REQUIRES - 组件的公共组件依赖项。

View File

@ -388,7 +388,10 @@ ESP-IDF v4.0 变更了链接器脚本片段文件使用的一些语法:
这些生成的包罗规则将用于未指定映射规则的情况。
``默认`` 协议在 :component_file:`esp_system/app.lf` 文件中定义,快速上手指南中提到的内置 ``noflash`` 协议和 ``rtc`` 协议也在该文件中定义。
``默认`` 协议在 :component_file:`esp_system/app.lf` 文件中定义。
快速上手指南中提到的内置 ``noflash`` 协议和 ``rtc`` 协议也在该文件中定义。
.. _ldgen-mapping-fragment :
@ -511,19 +514,18 @@ ESP-IDF v4.0 变更了链接器脚本片段文件使用的一些语法:
.. code-block:: none
. = ALIGN(8)
__my_sym_start = ABSOLUTE(.)
_my_sym_start = ABSOLUTE(.)
KEEP(lib1.a:obj1.*( SORT(.rodata) SORT(.rodata.*) ))
__my_sym_end = ABSOLUTE(.)
_my_sym_end = ABSOLUTE(.)
注意,正如在 flag 描述中提到的ALIGN 和 SURROUND 的使用对顺序敏感,因此如果将两者顺序调换后用到相同的映射片段,则会生成:
.. code-block:: none
__my_sym_start = ABSOLUTE(.)
_my_sym_start = ABSOLUTE(.)
. = ALIGN(8)
KEEP(lib1.a:obj1.*( SORT(.rodata) SORT(.rodata.*) ))
__my_sym_end = ABSOLUTE(.)
_my_sym_end = ABSOLUTE(.)
.. _ldgen-symbol-granularity-placements :

View File

@ -73,7 +73,9 @@ ESP-IDF 输出形式为 ``0x4_______`` 的十六进制代码地址后IDF 监
.. highlight:: none
ESP-IDF 应用程序发生 crash 和 panic 事件时,将产生如下的寄存器转储和回溯::
.. only:: CONFIG_IDF_TARGET_ARCH_XTENSA
ESP-IDF 应用程序发生 crash 和 panic 事件时,将产生如下的寄存器转储和回溯::
Guru Meditation Error of type StoreProhibited occurred on core 0. Exception was unhandled.
Register dump:
@ -86,7 +88,7 @@ ESP-IDF 应用程序发生 crash 和 panic 事件时,将产生如下的寄存
Backtrace: 0x400f360d:0x3ffb7e00 0x400dbf56:0x3ffb7e20 0x400dbf5e:0x3ffb7e40 0x400dbf82:0x3ffb7e60 0x400d071d:0x3ffb7e90
IDF 监视器为寄存器转储补充如下信息::
IDF 监视器为寄存器转储补充如下信息::
Guru Meditation Error of type StoreProhibited occurred on core 0. Exception was unhandled.
Register dump:
@ -107,6 +109,70 @@ IDF 监视器为寄存器转储补充如下信息::
0x400dbf82: app_main at /home/gus/esp/32/idf/examples/get-started/hello_world/main/./hello_world_main.c:33
0x400d071d: main_task at /home/gus/esp/32/idf/components/{IDF_TARGET_PATH_NAME}/./cpu_start.c:254
.. only:: CONFIG_IDF_TARGET_ARCH_RISCV
ESP-IDF 应用程序发生 crash 和 panic 事件时,将产生如下的寄存器转储和回溯::
abort() was called at PC 0x42067cd5 on core 0
Stack dump detected
Core 0 register dump:
MEPC : 0x40386488 RA : 0x40386b02 SP : 0x3fc9a350 GP : 0x3fc923c0
TP : 0xa5a5a5a5 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x3fc9a3b4 A0 : 0x3fc9a37c A1 : 0x3fc9a3b2
A2 : 0x00000000 A3 : 0x3fc9a3a9 A4 : 0x00000001 A5 : 0x3fc99000
A6 : 0x7a797877 A7 : 0x76757473 S2 : 0xa5a5a5a5 S3 : 0xa5a5a5a5
S4 : 0xa5a5a5a5 S5 : 0xa5a5a5a5 S6 : 0xa5a5a5a5 S7 : 0xa5a5a5a5
S8 : 0xa5a5a5a5 S9 : 0xa5a5a5a5 S10 : 0xa5a5a5a5 S11 : 0xa5a5a5a5
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fc9a350: 0xa5a5a5a5 0xa5a5a5a5 0x3fc9a3b0 0x403906cc 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a50
3fc9a370: 0x3fc9a3b4 0x3fc9423c 0x3fc9a3b0 0x726f6261 0x20292874 0x20736177 0x6c6c61635
3fc9a390: 0x43502074 0x34783020 0x37363032 0x20356463 0x63206e6f 0x2065726f 0x000000300
3fc9a3b0: 0x00000030 0x36303234 0x35646337 0x3c093700 0x0000002a 0xa5a5a5a5 0x3c0937f48
3fc9a3d0: 0x00000001 0x3c0917f8 0x3c0937d4 0x0000002a 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5e
3fc9a3f0: 0x0001f24c 0x000006c8 0x00000000 0x0001c200 0xffffffff 0xffffffff 0x000000200
3fc9a410: 0x00001000 0x00000002 0x3c093818 0x3fccb470 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a56
.....
通过分析堆栈转储 IDF 监视器为寄存器转储补充如下信息::
abort() was called at PC 0x42067cd5 on core 0
0x42067cd5: __assert_func at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdlib/assert.c:62 (discriminator 8)
Stack dump detected
Core 0 register dump:
MEPC : 0x40386488 RA : 0x40386b02 SP : 0x3fc9a350 GP : 0x3fc923c0
0x40386488: panic_abort at /home/marius/esp-idf_2/components/esp_system/panic.c:367
0x40386b02: rtos_int_enter at /home/marius/esp-idf_2/components/freertos/port/riscv/portasm.S:35
TP : 0xa5a5a5a5 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x00000004 S1 : 0x3fc9a3b4 A0 : 0x3fc9a37c A1 : 0x3fc9a3b2
A2 : 0x00000000 A3 : 0x3fc9a3a9 A4 : 0x00000001 A5 : 0x3fc99000
A6 : 0x7a797877 A7 : 0x76757473 S2 : 0xa5a5a5a5 S3 : 0xa5a5a5a5
S4 : 0xa5a5a5a5 S5 : 0xa5a5a5a5 S6 : 0xa5a5a5a5 S7 : 0xa5a5a5a5
S8 : 0xa5a5a5a5 S9 : 0xa5a5a5a5 S10 : 0xa5a5a5a5 S11 : 0xa5a5a5a5
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Backtrace:
panic_abort (details=details@entry=0x3fc9a37c "abort() was called at PC 0x42067cd5 on core 0") at /home/marius/esp-idf_2/components/esp_system/panic.c:367
367 *((int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
#0 panic_abort (details=details@entry=0x3fc9a37c "abort() was called at PC 0x42067cd5 on core 0") at /home/marius/esp-idf_2/components/esp_system/panic.c:367
#1 0x40386b02 in esp_system_abort (details=details@entry=0x3fc9a37c "abort() was called at PC 0x42067cd5 on core 0") at /home/marius/esp-idf_2/components/esp_system/system_api.c:108
#2 0x403906cc in abort () at /home/marius/esp-idf_2/components/newlib/abort.c:46
#3 0x42067cd8 in __assert_func (file=file@entry=0x3c0937f4 "", line=line@entry=42, func=func@entry=0x3c0937d4 <__func__.8540> "", failedexpr=failedexpr@entry=0x3c0917f8 "") at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdlib/assert.c:62
#4 0x4200729e in app_main () at ../main/iperf_example_main.c:42
#5 0x42086cd6 in main_task (args=<optimized out>) at /home/marius/esp-idf_2/components/freertos/port/port_common.c:133
#6 0x40389f3a in vPortEnterCritical () at /home/marius/esp-idf_2/components/freertos/port/riscv/port.c:129
IDF 监视器在后台运行以下命令,解码各地址::
{IDF_TARGET_TOOLCHAIN_PREFIX}-addr2line -pfiaC -e build/PROJECT.elf ADDRESS
@ -201,7 +267,6 @@ Windows 环境下已知问题
- 偶然情况下,``idf.py````make`` 退出时,可能会在 IDF 监视器恢复之前暂停 30 秒。
- GDB 运行时,可能会暂停一段时间,然后才开始与 GDBStub 进行通信。
.. _addr2line: https://sourceware.org/binutils/docs/binutils/addr2line.html
.. _gdb: https://sourceware.org/gdb/download/onlinedocs/
.. _pySerial: https://github.com/pyserial/pyserial

View File

@ -177,4 +177,4 @@ ULP 协处理器代码是用汇编语言编写的,并使用 `binutils-esp32ulp
如果想禁用定时器(有效防止 ULP 程序再次运行),可在 ULP 代码或主程序中清除 ``RTC_CNTL_STATE0_REG`` 寄存器中的 ``RTC_CNTL_ULP_CP_SLP_TIMER_EN`` 位。
.. _binutils-esp32ulp 工具链: https://github.com/espressif/binutils-esp32ulp
.. _binutils-esp32ulp 工具链: https://github.com/espressif/binutils-esp32ulp

View File

@ -182,9 +182,7 @@ DUT2slave终端::
烧写完成后重启 {IDF_TARGET_NAME} 它将启动单元测试程序。
当单元测试应用程序空闲时,输入回车键,它会打印出测试菜单,其中包含所有的测试项目。
.. code::
当单元测试应用程序空闲时,输入回车键,它会打印出测试菜单,其中包含所有的测试项目::
Here's the test menu, pick your combo:
(1) "esp_ota_begin() verifies arguments" [ota]
@ -294,4 +292,4 @@ ESP-IDF 有一个集成 CMock mocking 框架的组件。CMock 通常使用 Unity
${MOCK_OUTPUT} 包含所有 CMock 生成的输出文件,${MOCK_HEADERS} 包含所有要 mock 的头文件, ${CMOCK_DIR} 需要设置为 IDF 内的 CMock 目录。${CMAKE_COMMAND} 会自动设置。
更多关于 CMock 如何工作以及如何创建和使用 mock 的信息,请参考 :component_file:`cmock/CMock/docs/CMock_Summary.md`
更多关于 CMock 如何工作以及如何创建和使用 mock 的信息,请参考 :component_file:`cmock/CMock/docs/CMock_Summary.md`