Keep legacy ULP apps on the CMake v1 build path while buildv2 coverage
is limited to full_subproject ULP apps.
Also add the missing esp_driver_gpio dependency to the esp_pm test app
so buildv2 dependency checks see driver/rtc_io.h explicitly.
Add examples/system/ulp/lp_core/build_system_v2/ demonstrating the
cmakev2 ULP build with native IDF component support, Kconfig
integration, component manager usage, linker scripts (static and
ldgen-processed), and per-project menuconfig.
The example shows a custom ULP project (via ulp_add_project) structured
as a proper IDF-like project with a main component and
idf_build_executable(). The ULP sub-project runs its own kconfgen with
the parent's sdkconfig as SDKCONFIG_DEFAULTS, inheriting the parent's
IDF configuration while adding ULP-specific Kconfig options from its
own components.
Three components demonstrate different integration mechanisms:
- ulp_sum and ulp_math: pure cmakev2 components in the components/
subdirectory, using add_library(${COMPONENT_TARGET}) directly.
Each provides a Kconfig file with configurable options.
- ulp_clamp: an external component in the extra/ subdirectory,
declared as a local path dependency in ulp_sum/idf_component.yml.
The component manager resolves this dependency automatically.
ulp_clamp also provides a Kconfig file with a configurable
maximum clamp value (CONFIG_ULP_CLAMP_MAX_VALUE).
Linker script support is demonstrated in two ways:
- Static linker script: ulp_math registers ulp_math_sections.ld via
idf_component_set_property(LINKER_SCRIPTS), defining a custom
linker symbol (ulp_math_version).
- ldgen-processed template: ulp_math provides a linker fragment file
(ulp_math.lf) that describes a custom .ulp_math_fast section
placement. The main component registers ulp_sections.ld.in via
target_linker_script(PROCESS), which ldgen processes using the
fragment to generate the final linker script. The
ulp_math_multiply() function is placed in .ulp_math_fast using
__attribute__((section)). Both static and ldgen linker scripts
are handled by the standard idf_build_library() flow without any
ULP-specific linker script functions.
The ULP project has its own sdkconfig.defaults that overrides the
ulp_clamp default (100 instead of 255), demonstrating per-project
configuration layering. Users can append to SDKCONFIG_DEFAULTS
before include(idf.cmake) to add project-specific defaults.
A menuconfig-<app_name> target is registered in the parent build,
allowing ULP-specific configuration via:
idf.py --no-hints menuconfig-ulp_build_system_example
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
fix(ulp/lp_core): fix LP UART data_bits validation and add full word-length test coverage
Closes PM-715, PM-660, IDFCI-10410, and IDFCI-10464
See merge request espressif/esp-idf!47432
Add LP SPI HAL LL layer for ESP32-S31 and ESP32-P4, enable the
peripheral in soc_caps, and port the HP-side and LP-core-side SPI
drivers to use the new LL abstraction.
Several LP core pytest files were either hardcoded to specific chip lists
or using a less-precise SOC capability filter:
- test_lp_core_multi_device: was locked to ['esp32c6'] pending a workaround
for LP I2C on esp32p4; all three active LP core chips now have
SOC_LP_I2C_SUPPORTED=1, so switch to soc_filtered_targets.
- test_lp_uart_wakeup_modes: was using SOC_LP_CORE_SUPPORTED which is
semantically wrong for a UART test; change to SOC_ULP_LP_UART_SUPPORTED.
- LP core example pytests (build_system, interrupt, gpio_intr_pulse_counter,
lp_timer_interrupt): replace hardcoded ['esp32c5', 'esp32c6', 'esp32p4']
with soc_filtered_targets('SOC_LP_CORE_SUPPORTED == 1') so that new
chips automatically get coverage when their SOC cap is enabled.
This example shows how to have both ULP FSM and RISCV enabled in kconfig
simultaneously, and use them one after another at run time. A new
parameter TYPE is passed to ulp_embed_binary() function to specify fsm
or riscv in CMakeLists.txt. This way, both ulp_fsm and ulp_riscv source
files can be compiled by their respective toolchains under the same
project.
The example shows ULP FSM incrementing a counter from 0 to 100, ULP
RISC-V incrementing from 100 to 500 and main CPU incrementing from 500
to 1500.
Updated kconfig option type and other supporting changes in build system
to allow enabling both ULP FSM and ULP RISCV simultaneously. Users can
choose at run time which one to initialize and use.
NOTE: Both ULP FSM and ULP RISCV can't be used simultaneously at run
time because they share some common hardware like RTC slow memory space.
Closes https://github.com/espressif/esp-idf/issues/12999
Fixes for LP ADC to work when used from the LP core
Closes PM-646, IDFCI-5374, IDFCI-5375, IDFCI-5376, and IDFCI-5377
See merge request espressif/esp-idf!45165
Added a pulse counter example code for ulp riscv chips. The example
works by HP core generating high frequency pulses on a GPIO, which
are counted by ULP core to find out the highest possible frequency
of pulses that can be achieved without missing any edges.