Merge branch 'docs/add_cn_trans_for_ulp-lp-core.rst_in_api-reference_system' into 'master'
docs: Provide Chinese translation for api-reference/system/ulp-lp-core.rst Closes DOC-6335 See merge request espressif/esp-idf!26086
This commit is contained in:
@@ -8,12 +8,11 @@ The ULP LP-Core (Low-power core) coprocessor is a variant of the ULP present in
|
||||
The ULP LP-Core coprocessor has the following features:
|
||||
|
||||
* Utilizes a 32-bit processor based on the RISC-V ISA, encompassing the standard extensions integer (I), multiplication/division (M), atomic (A), and compressed (C).
|
||||
* Interrupt controller
|
||||
* Interrupt controller.
|
||||
* Includes a debug module that supports external debugging via JTAG.
|
||||
* Can access all of the High-power (HP) SRAM and peripherals when the entire system is active.
|
||||
* Can access the Low-power (LP) SRAM and peripherals when the HP system is in sleep mode.
|
||||
|
||||
|
||||
Compiling Code for the ULP LP-Core
|
||||
----------------------------------
|
||||
|
||||
@@ -31,29 +30,27 @@ The ULP LP-Core code is compiled together with your ESP-IDF project as a separat
|
||||
|
||||
ulp_embed_binary(${ulp_app_name} "${ulp_sources}" "${ulp_exp_dep_srcs}")
|
||||
|
||||
The first argument to ``ulp_embed_binary`` specifies the ULP binary name. The name specified here is also used by other generated artifacts such as the ELF file, map file, header file, and linker export file. The second argument specifies the ULP 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 is created before any of these files are compiled. See the 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 is also used by other generated artifacts such as the ELF file, map file, header file, and linker export file. The second argument specifies the ULP 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 is created before any of these files are compiled. See the section below for the concept of generated header files for ULP applications.
|
||||
1. Enable both :ref:`CONFIG_ULP_COPROC_ENABLED` and :ref:`CONFIG_ULP_COPROC_TYPE` in menucofig, and set :ref:`CONFIG_ULP_COPROC_TYPE` to ``CONFIG_ULP_COPROC_TYPE_LP_CORE``. The :ref:`CONFIG_ULP_COPROC_RESERVE_MEM` option reserves RTC memory for the ULP and must be set to a value big enough to store both the ULP LP-Core code and data. If the application components contain multiple ULP programs, then the size of the RTC memory must be sufficient to hold the largest one.
|
||||
|
||||
3. Enable both :ref:`CONFIG_ULP_COPROC_ENABLED` and :ref:`CONFIG_ULP_COPROC_TYPE` to ``CONFIG_ULP_COPROC_TYPE_LP_CORE`` options in menuconfig. The :ref:`CONFIG_ULP_COPROC_RESERVE_MEM` option reserves RTC memory for the ULP and must be set to a value big enough to store both the ULP LP-Core code and data. If the application components contain multiple ULP programs, then the size of the RTC memory must be sufficient to hold the largest one.
|
||||
2. Build the application as usual (e.g., ``idf.py app``).
|
||||
|
||||
During the build process, the following steps are taken to build ULP program:
|
||||
|
||||
4. Build the application as usual (e.g., ``idf.py app``).
|
||||
1. **Run each source file through the C compiler and assembler.** This step generates the object files ``.obj.c`` or ``.obj.S`` in the component build directory depending on the source file processed.
|
||||
|
||||
During the build process, the following steps are taken to build ULP program:
|
||||
2. **Run the linker script template through the C preprocessor.** The template is located in ``components/ulp/ld`` directory.
|
||||
|
||||
1. **Run each source file through the C compiler and assembler.** This step generates the object files (``.obj.c`` or ``.obj.S`` depending of source file processed) in the component build directory.
|
||||
3. **Link the object files into an output ELF file** (``ulp_app_name.elf``). The Map file ``ulp_app_name.map`` generated at this stage may be useful for debugging purposes.
|
||||
|
||||
2. **Run the linker script template through the C preprocessor.** The template is located in ``components/ulp/ld`` directory.
|
||||
4. **Dump the contents of the ELF file into a binary** (``ulp_app_name.bin``) which can then be embedded into the application.
|
||||
|
||||
3. **Link the object files into an output ELF file** (``ulp_app_name.elf``). The Map file (``ulp_app_name.map``) generated at this stage may be useful for debugging purposes.
|
||||
5. **Generate a list of global symbols** (``ulp_app_name.sym``) in the ELF file using ``riscv32-esp-elf-nm``.
|
||||
|
||||
4. **Dump the contents of the ELF file into a binary** (``ulp_app_name.bin``) which can then be embedded into the application.
|
||||
6. **Create an LD export script and a header file** ``ulp_app_name.ld`` and ``ulp_app_name.h`` containing the symbols from ``ulp_app_name.sym``. This is done using the ``esp32ulp_mapgen.py`` utility.
|
||||
|
||||
5. **Generate a list of global symbols** (``ulp_app_name.sym``) in the ELF file using ``riscv32-esp-elf-nm``.
|
||||
|
||||
6. **Create an LD export script and a header file** (``ulp_app_name.ld`` and ``ulp_app_name.h``) containing the symbols from ``ulp_app_name.sym``. This is done using the ``esp32ulp_mapgen.py`` utility.
|
||||
|
||||
7. **Add the generated binary to the list of binary files** to be embedded into the application.
|
||||
7. **Add the generated binary to the list of binary files** to be embedded into the application.
|
||||
|
||||
.. _ulp-lp-core-access-variables:
|
||||
|
||||
@@ -144,9 +141,9 @@ The ULP has the following wake-up sources:
|
||||
When the ULP is woken up, it will go through the following steps:
|
||||
|
||||
1. Initialize system feature, e.g., interrupts
|
||||
2. Call user code: ``main()``
|
||||
2. Call user code ``main()``
|
||||
3. Return from ``main()``
|
||||
4. If ``lp_timer_sleep_duration_us`` is specified then configure the next wake-up alarm
|
||||
4. If ``lp_timer_sleep_duration_us`` is specified, then configure the next wake-up alarm
|
||||
5. Call :cpp:func:`ulp_lp_core_halt`
|
||||
|
||||
ULP LP-Core Peripheral Support
|
||||
@@ -168,11 +165,13 @@ API Reference
|
||||
|
||||
Main CPU API Reference
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include-build-file:: inc/ulp_lp_core.inc
|
||||
.. include-build-file:: inc/lp_core_i2c.inc
|
||||
|
||||
LP Core API Reference
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. include-build-file:: inc/ulp_lp_core_utils.inc
|
||||
.. include-build-file:: inc/ulp_lp_core_gpio.inc
|
||||
.. include-build-file:: inc/ulp_lp_core_i2c.inc
|
||||
|
||||
Reference in New Issue
Block a user