488 Commits

Author SHA1 Message Date
Sudeep Mohanty
c105ea3af8 fix(ulp): initialize sources to prevent scope leakage in cmakev2 2026-05-21 10:05:48 +02:00
Marius Vikhammer
b35f528beb test(ulp): migrate I2C tests to new slave driver 2026-05-15 09:38:52 +08:00
Marius Vikhammer
652f605d8b Merge branch 'bugfix/ulp_riscv_rtc_i2c_test_fix' into 'master'
fix(ulp_riscv_i2c): Fix spurious pass in RTC I2C multi-device test

See merge request espressif/esp-idf!48497
2026-05-14 09:14:17 +08:00
Sudeep Mohanty
0d869cad61 fix(ulp_riscv_i2c): Fix spurious pass in RTC I2C multi-device test
The test was passing without real I2C communication due to a GPIO
mismatch (slave on GPIO 6/7 vs RTC I2C master on GPIO 2/3), single-byte
zero-coincidence, unchecked ULP return values, and an insufficient
RTC I2C timeout.

Fix slave GPIOs, increase test length, check I2C return values, add
proper assertions, and set an adequate RTC I2C timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 14:30:55 +02:00
Marius Vikhammer
73dc40eb8a Merge branch 'feature/s31_lp_i2c' into 'master'
feat(ulp): support I2C on ULP for S31

Closes IDF-14635

See merge request espressif/esp-idf!48405
2026-05-13 08:31:29 +08:00
Sudeep Mohanty
fbd587f10d Merge branch 'refactor/lp_periph_io_for_lp_core' into 'master'
refactor(ulp): use lp_gpio_matrix_* for LP core peripheral IO on matrix targets

See merge request espressif/esp-idf!48114
2026-05-12 14:02:08 +02:00
Marius Vikhammer
ab9cf37a1b feat(ulp): support I2C on ULP for S31 2026-05-12 17:32:23 +08:00
Marius Vikhammer
88b39e88c4 feat(ulp): support lp-core PMP on ESP32-S31 2026-05-12 09:20:30 +08:00
Sudeep Mohanty
6f044e6e81 refactor(ulp): use lp_gpio_matrix_* for LP core peripheral IO on matrix targets
On SOC_LP_GPIO_MATRIX_SUPPORTED targets, use lp_gpio_matrix_input and
lp_gpio_matrix_output instead of lp_gpio_connect_* so matrix outputs use
rtcio_hal_matrix_out (LP GPIO IOMUX applied in HAL).

LP UART remapped pins: drop rtc_gpio_iomux_func_sel(pin, 1); rtc_gpio_init
already selects RTCIO_LL_PIN_FUNC.

Non-matrix LP I2C: select dedicated LP I2C RTC IOMUX via rtc_gpio_iomux_output
(same mux register write as rtc_gpio_iomux_func_sel; matches HAL naming for
peripheral-owned output enable on dedicated mux functions).
2026-05-11 13:30:23 +02:00
Marius Vikhammer
2fa1906b0a Merge branch 'feature/s31_lp_mailbox' into 'master'
feat(ulp): enable LP mailbox on S31

Closes IDF-14637

See merge request espressif/esp-idf!48218
2026-05-09 10:58:41 +08:00
Marius Vikhammer
8611150899 Merge branch 'bugfix/ulp_max_mem' into 'master'
fix(ulp): correct target LP memory reservation limits

Closes IDF-11974

See merge request espressif/esp-idf!48065
2026-05-08 14:08:21 +08:00
Marius Vikhammer
6023f07868 feat(ulp): add support for mailbox on S31 2026-05-08 14:06:04 +08:00
Marius Vikhammer
0ab385ab88 fix(ulp): correct target LP memory reservation limits
The configured maximum should match each target's fixed LP/RTC
reservations so menuconfig does not advertise values that the linker
cannot support.

Keep the linker failure explicit about CONFIG_ULP_COPROC_RESERVE_MEM
because application RTC sections still share the remaining LP/RTC RAM.
2026-05-06 17:37:35 +08:00
Marius Vikhammer
353b637e16 Merge branch 'feature/s31_lp_uart_ulp' into 'master'
feat(ulp): add lp uart support for ULP on S31

Closes IDF-14634 and IDF-15567

See merge request espressif/esp-idf!48055
2026-05-06 15:43:12 +08:00
Marius Vikhammer
66d1d594e4 feat(ulp): add lp uart support for ULP on S31 2026-04-29 16:20:43 +08:00
Song Ruo Jing
1d50587ab2 refactor(rtcio): split rtcio/gpio switch with rtc iomux func sel func
This allows rtc_gpio_deinit to always switch the pad back to GPIO,
regardless of lp io clock enabled or not, so that gpio_config can
always switch the IO back to GPIO use after wakeup from deep sleep.
2026-04-29 12:17:37 +08:00
Marius Vikhammer
09f3b007f9 Merge branch 'feature/lp_core_hp_mem_support' into 'master'
feat(ulp): support placing ULP app in HP-RAM

See merge request espressif/esp-idf!47395
2026-04-29 11:33:04 +08:00
Marius Vikhammer
261bd160aa feat(ulp): support placing ULP app in HP-RAM 2026-04-29 09:47:33 +08:00
Sudeep Mohanty
cc025fa3d5 Merge branch 'fix/lp_uart_data_bits' into 'master'
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
2026-04-28 08:43:03 +02:00
Marius Vikhammer
defe1cde71 feat(ulp/lp_spi): bring up LP SPI on ESP32-S31
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.
2026-04-28 10:20:02 +08:00
Sudeep Mohanty
4155acbdd1 fix(lp_core): repair LP UART read_bytes RX handling
Made-with: Cursor
2026-04-23 10:10:05 +02:00
Sudeep Mohanty
57b301f036 test(lp_core): add LP UART read_bytes multi-device tests
Made-with: Cursor
2026-04-23 10:10:05 +02:00
Sudeep Mohanty
3b36e9d094 fix(lp_core): fix multi-device LP UART test failures on esp32p4
The multi-device LP UART tests were failing on esp32p4 due to several
issues in the test harness:

- LP ROM boot banner: On chips with LP ROM (esp32p4), the LP core emits
  a ROM banner on LP UART during startup, corrupting the first bytes of
  test data. Set skip_lp_rom_boot=true in the ULP config for write, read
  and mismatch tests to suppress this.

- Stale FIFO data: The HP UART RX FIFO could accumulate garbage during
  pin mux setup. Add uart_flush_input() after HP UART driver installation
  and before each read phase. Call lp_core_uart_clear_buf() before LP-side
  read tests to flush the LP UART RX FIFO as well.

- Missing synchronization: The HP reader could start listening before
  the LP transmitter was ready (or vice versa), causing data loss at
  higher baud rates. Add signal exchange (unity_send_signal /
  unity_wait_for_signal) to coordinate LP-to-HP data transfers.

- Short read timeout: The uart_read_bytes() timeout of 10 ms was too
  aggressive for slower baud rates. Increase to 100 ms.

Made-with: Cursor
2026-04-23 10:10:05 +02:00
Sudeep Mohanty
359cec50bb test(lp_core): use soc_filtered_targets for all LP core pytest parametrization
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.
2026-04-23 10:10:05 +02:00
Sudeep Mohanty
f6c7def543 test(lp_core): extend LP UART multi-device test coverage
Refactor the LP UART multi-device tests to use a single parameterised
helper pair (test_lp_uart_write_cfg / test_lp_uart_read_cfg) instead of
one-off functions per config, and extend coverage to:

- write and read tests for 5-, 6-, 7-bit and even-parity configurations
- negative tests: word-length mismatch (FRAM_ERR recovery on LP side,
  garbled receive on HP side)
- LP GPIO Matrix routing tests (SOC_LP_GPIO_MATRIX_SUPPORTED chips only):
  swaps the default TX/RX GPIO numbers so both pins go through the LP GPIO
  Matrix, covering the lp_gpio_connect_in/out_signal() branch of
  lp_uart_config_io() that was previously untested at the data-transfer
  level; the same physical cross-wiring as all other LP UART tests is reused

Add rtc_gpio_deinit() cleanup at the end of single-board LP UART tests
so configured pins are returned to HP/digital mode and do not interfere
with subsequent tests that may reuse the same GPIOs.
2026-04-23 09:06:16 +02:00
Sudeep Mohanty
952dca66bf fix(lp_core): skip LP UART RTS/CTS pin setup when flow control is disabled
lp_core_uart_set_pin() unconditionally configured the RTS and CTS GPIO
pins even when flow control was disabled. Only configure the RTS pin
when UART_HW_FLOWCTRL_RTS is set, and the CTS pin when
UART_HW_FLOWCTRL_CTS is set.
2026-04-23 09:06:16 +02:00
Sudeep Mohanty
eb6ffbf1ee fix(lp_core): fix LP UART IOMUX pin not bypassing LP GPIO Matrix for RX
On chips with SOC_LP_GPIO_MATRIX_SUPPORTED (esp32p4, esp32s31), when the
default IOMUX pin is used for LP UART, calling rtc_gpio_iomux_func_sel()
alone only selects the IOMUX function on the pad side but does not set
sig_in_sel=0 on the peripheral side. This leaves the LP UART RX input
still reading from the LP GPIO Matrix (where no signal is connected),
causing RX to receive nothing.

Apply the same fix that was already in the HP UART driver: use
rtc_gpio_iomux_input() / rtc_gpio_iomux_output() which additionally
configure the peripheral to bypass the LP GPIO Matrix for IOMUX pins.
2026-04-23 09:06:16 +02:00
Sudeep Mohanty
a80f451362 fix(lp_core): fix LP UART init parameter validation
Align data_bits, flow_ctrl, and rx_flow_ctrl_thresh checks with uart_param_config().

Made-with: Cursor
2026-04-23 09:06:12 +02:00
hebinglin
b8e0ee431c change(ulp): add HP Core wakeup causes save test cases 2026-04-22 16:22:13 +08:00
hebinglin
0603e0eb23 fix(ulp): record wakeup causes before lp core request sleep 2026-04-22 16:22:11 +08:00
Marius Vikhammer
10637dbf5e feat(ulp): add support for ulp on esp32s31 2026-04-20 14:45:23 +08:00
He Binglin
4e1b02d90c Merge branch 'change/esp_idf_ulp_add_int_api' into 'master'
change(ulp): add lp periph intr enable apis

See merge request espressif/esp-idf!47160
2026-04-14 17:23:22 +08:00
hebinglin
40d8483c2e change(ulp): add lp periph intr enable apis 2026-04-14 12:24:17 +08:00
Eren Terzioglu
ba8d16dbd4 fix(ulp): Fix build warning for esp32p4 lpcore 2026-03-24 18:47:32 +01:00
Meet Patel
a3f167f1c4 refactor(ulp): Allow both ULP-FSM and ULP-RISCV to enable at build time
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
2026-03-15 14:01:30 +05:30
Frantisek Hrbata
f46b26fa47 fix(ulp): add sdkconfig directory to ULP target include directories
The ULP sources include sdkconfig.h for compile-time configuration
values. The sdkconfig directory was previously available to the ULP
target indirectly through the COMPONENT_INCLUDES variable, which is
populated from the parent component's INTERFACE_INCLUDE_DIRECTORIES.
In cmake v1, idf_component_register() adds the config_dir as PUBLIC
include directory to every component (component.cmake:498), so it
ends up in INTERFACE_INCLUDE_DIRECTORIES and gets passed to the ULP
subproject via COMPONENT_INCLUDES.

In cmakev2, the config_dir is added as a build-level property and
applied to components as PRIVATE (component.cmake:1053), so it no
longer appears in INTERFACE_INCLUDE_DIRECTORIES. As a result, the
sdkconfig directory is missing from the ULP target's include paths.

Add the sdkconfig directory explicitly to the ULP target's include
directories. Note that SDKCONFIG_HEADER is already passed to the ULP
subproject and its directory is already extracted into sdkconfig_dir
for linker script preprocessing (IDFULPProject.cmake:40).

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-11 15:44:30 +08:00
Marius Vikhammer
d2567b6e45 Merge branch 'fix/lp_core_wake_stub_pmu_sw_int' into 'master'
fix(esp_hw_support): clear LP core SW interrupt in wake stub before sleep

Closes IDFGH-17328

See merge request espressif/esp-idf!46337
2026-03-11 13:35:52 +08:00
Marius Vikhammer
cc9a929ea6 fix(esp_hw_support): clear LP core SW interrupt in wake stub before sleep
When ulp_lp_core_wakeup_main_processor() is called, it sets the
PMU_SW_INT_RAW bit on the HP side. The normal sleep path clears this
bit before re-entering sleep, but esp_wake_stub_sleep() did not, leaving
the wakeup cause sticky. This caused the PMU to immediately re-trigger a
wakeup as soon as sleep was requested from the wake stub, producing a
rapid re-wakeup loop that eventually triggered LP_WDT_SYS resets.

Add a test case that verifies the wake stub can return to sleep correctly
across multiple LP core wakeup cycles without the re-wakeup bug.

Closing https://github.com/espressif/esp-idf/issues/18308

Made-with: Cursor
2026-03-09 10:56:33 +08:00
Konstantin Kondrashov
74561963e1 feat(ulp): Improved ULP delay API accuracy and removed floating point operations
Closes https://github.com/espressif/esp-idf/issues/17494
Closes https://github.com/espressif/esp-idf/issues/16891
2026-03-05 10:39:34 +02:00
He Binglin
1b547ca0ba Merge branch 'bugfix/esp_idf_s3_deepsleep_dead' into 'master'
fix(hal): fix the issue of dual-core contention for RTC_CNTL regs

See merge request espressif/esp-idf!41680
2026-03-02 11:35:53 +08:00
puyogo-suzuki
75323ea767 fix(ulp): disable unsupported LP_IO_NUM7 for ESP32-C5 2026-02-25 11:20:00 +02:00
Wu Zheng Hui
ad1f0f870b Merge branch 'feat/support_esp32s31_pmu_basic' into 'master'
feat(esp_hw_support): support esp32s31 pmu basic

Closes IDF-14642

See merge request espressif/esp-idf!45494
2026-02-24 14:11:27 +08:00
Meet Patel
7b30754d33 fix(ulp): correct ULP LP and RISCV interrupt wait cycle duration
Current implementation of interrupt wait cycle calculation depends on a
delay and local counter method, which is inaccurate in achieving precise
timeouts. This commit updates the implementaion to use CPU cycles
instead, as they are more accurate.

Closes https://github.com/espressif/esp-idf/pull/18208
2026-02-19 13:32:31 +05:30
wuzhenghui
0b27301a09 feat(soc): support esp32s31 lp_aon & rtc_wdt & rtc_timer 2026-02-11 15:03:35 +08:00
hebinglin
baeabe48c3 fix(hal): fix the issue of dual-core contention for RTC_CNTL regs 2026-02-10 12:08:03 +08:00
Sudeep Mohanty
12fdd20da1 Merge branch 'fix/lp_adc_not_working_on_lp_core' into 'master'
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
2026-02-09 12:29:41 +01:00
Marius Vikhammer
5f914189c2 ci(core): removed common_components from core test-apps dependencies 2026-01-26 11:47:23 +08:00
Igor Udot
f4cb052666 Merge branch 'ci/base_components' into 'master'
ci: use common_components in depends_components

See merge request espressif/esp-idf!45070
2026-01-26 09:08:11 +08:00
morris
0469db2f83 refactor(rcc): unify the usage of clock control macros for peripherals
- Removed conditional definitions for various RCC_ATOMIC macros across
multiple files, replacing them with a unified PERIPH_RCC_ATOMIC() macro.
- Updated instances where specific RCC_ATOMIC macros were used to ensure
consistent usage of PERIPH_RCC_ATOMIC().
- Deleted unused uart_share_hw_ctrl.h file as its functionality is now
integrated into the new structure.
2026-01-23 18:28:13 +08:00
igor.udot
4c26ab876b ci: update build-test-rules to use common_components 2026-01-23 10:14:09 +08:00