xtensa/espressif: Update common-source integration for Xtensa devices#18614
Open
tmedicci wants to merge 1 commit intoapache:masterfrom
Open
xtensa/espressif: Update common-source integration for Xtensa devices#18614tmedicci wants to merge 1 commit intoapache:masterfrom
tmedicci wants to merge 1 commit intoapache:masterfrom
Conversation
fdcavalcanti
previously approved these changes
Mar 26, 2026
This commit updates the common-source integration for Xtensa-based Espressif devices (ESP32, ESP32-S2, and ESP32-S3). This is part of a larger common-source update split by architecture for better maintainability. Major components updated: - IRQ allocator refactoring with intr_alloc integration - Common-source drivers (GPIO, RMT, I2C, SPI, UART, etc.) - Espressif components upgrade to release/master.b-test - Peripheral drivers (ADC, PWM, LEDC, MCPWM, PCNT, Temperature Sensor, etc.) - Wireless adapters (Wi-Fi and BLE) - esp_timer migration to the common-source path for Xtensa devices - Common-source power management implementation (auto-sleep and wakeup paths) - Board defconfigs for all Xtensa Espressif boards - SMP support improvements for ESP32-S3 - Critical section handling improvements Key architectural changes: - IRQ Allocator: The new interrupt allocator enables multiple mapping options from interrupt sources to CPU interrupts, providing flexibility required by modern peripherals. Although this introduces breaking changes to the interrupt handling API, the required ARCH_MINIMAL_VECTORTABLE Kconfig option is explicitly checked during startup to ensure proper configuration. This validation prevents runtime issues from configuration mismatches. - Xtensa-specific interrupt handling via esp_xtensa_intr.c providing NuttX-native implementations of xt_ints_on/off and interrupt handlers, avoiding conflicts with NuttX's core Xtensa macros. - Timer/RTC unification: ESP32/ESP32-S2/ESP32-S3 move from chip-specific RTC/RT-timer code to common-source Espressif integration, including esp_timer_adapter/esp_rtc paths and the required bringup/defconfig updates. - Power management consolidation: Xtensa PM follows the common-source implementation, including common-source auto-sleep behavior, UART/Wi-Fi wakeup coordination, and tickless-safe sleep flow compatibility. Note: This is a large commit to maintain bisectability. Breaking the changes into smaller commits would result in non-building intermediate states across the common-source infrastructure update. Tested configurations: - All defconfigs were tested, including `ostest`. Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
e23db6a to
398e31e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Following #18492, this PR updates the common-source integration for Xtensa-based
Espressif devices (ESP32, ESP32-S2, and ESP32-S3). This is part of a larger common-source update split by architecture for better maintainability.
Major components updated:
Key architectural changes:
ARCH_MINIMAL_VECTORTABLEKconfig option is explicitly checked during startup to ensure proper configuration. This validation prevents runtime issues from configuration mismatches.Note: This is a large commit to maintain bisectability. Breaking the changes into smaller commits would result in non-building intermediate states across the common-source infrastructure update.
Note to the Reviewers:
Although it's a huge PR, reviewing it is not that difficult. Some key points can be summarized here:
nuttx/arch/xtensa/src/common/espressif/) are mostly related to either path changes and the new IRQ allocator.espXX_rt_timer, which was moved to a common-source approach. Public API's didn't change.defconfigswere updated to be compatible with the new IRQ allocator. Although it is a breaking change from user's perspective, the required Kconfig-selectable options are checked atarch/xtensa/src/common/espressif/esp_irq.cImpact
Impact on user: Yes, they need to update their defconfig to select the following Kconfig:
Please note that these options are checked with pre-processor macros, so it can't be "left behind".
Impact on build: Yes. Build will fail if the newer Kconfig options aren't selected.
Impact on hardware: Yes. This change is mandatory to support newer Espressif devices on NuttX.
Impact on documentation: No.
Impact on security: No.
Impact on compatibility: Yes, this is a breaking change with minor effects. The missing Kconfig options are checked with pre-processor macros and guide the user to select the required configs.
Testing
All Espressif's defconfigs were tested with hardware in the loop. In addition to peripherals' testing,
ostestis checked tooBuilding
Cleaning Existing Builds
Select either ESP32, ESP32-S2 or ESP32-S3
ESP32
ESP32-S2
ESP32-S3
Building and Flashing
Running
Results