EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1507 background imageLoading...
Page #1507 background image
Chapter 4. API Guides
M_BX(label_num)
Macro: unconditional branch to label
This macro generates two ulp_insn_t values separated by a comma, and should be used when defining
contents of ulp_insn_t arrays. First value is not a real instruction; it is a token which is removed by
ulp_process_macros_and_load function.
M_BXZ(label_num)
Macro: branch to label if ALU result is zero
This macro generates two ulp_insn_t values separated by a comma, and should be used when defining
contents of ulp_insn_t arrays. First value is not a real instruction; it is a token which is removed by
ulp_process_macros_and_load function.
M_BXF(label_num)
Macro: branch to label if ALU overflow
This macro generates two ulp_insn_t values separated by a comma, and should be used when defining
contents of ulp_insn_t arrays. First value is not a real instruction; it is a token which is removed by
ulp_process_macros_and_load function.
Defines
RTC_SLOW_MEM
RTC slow memory, 8k size
The ULP (Ultra Low Power) coprocessor is a simple FSM (Finite State Machine) which is designed to perform
measurements using the ADC, temperature sensor, and external I2C sensors, while the main processors are in deep
sleep mode. The ULP coprocessor can access the RTC_SLOW_MEM memory region, and registers in RTC_CNTL,
RTC_IO, and SARADC peripherals. The ULP coprocessor uses fixed-width 32-bit instructions, 32-bit memory
addressing, and has 4 general-purpose 16-bit registers.
4.28.3 Installing the Toolchain
The ULP coprocessor code is written in assembly and compiled using the binutils-esp32ulp toolchain.
If you have already set up ESP-IDF with CMake build system according to the Getting Started Guide, then the ULP
toolchain will already be installed.
4.28.4 Compiling the ULP Code
To compile the ULP code as part of the component, the following steps must be taken:
1. The ULP code, written in assembly, must be added to one or more files with .S extension. These files must be
placed into a separate directory inside the component directory, for instance ulp/.
2. Call ulp_embed_binary from the component CMakeLists.txt after registration. For example:
...
idf_component_register()
set(ulp_app_name ulp_${COMPONENT_NAME})
set(ulp_s_sources ulp/ulp_assembly_source_file.S)
set(ulp_exp_dep_srcs "ulp_c_source_file.c")
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 species 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.
Espressif Systems 1496
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish