Skip to content

Conversation

@fdcavalcanti
Copy link
Contributor

Summary

  • arch/risc-v: update lower-half drivers for ESP32-C3|C6|H2
  • arch/xtensa: update lower-half drivers for ESP32|S2|S3

Hi folks,

This PR updates the lower-half drivers for Espressif devices.
The following SoCs are affected: ESP32, ESP32S2, ESP32S3, ESP32C3, ESP32C6 and ESP32H2.

Main topics to take from this update:

  • New features are NOT added
  • It is not fixing existing issues or bugs reported
  • This update is necessary so we can support new devices on NuttX

There are changes at board and arch level, those can't be separated as it would break the build because linker script changes are required.

Thanks to @eren-terzioglu and @tmedicci for helping on update!

Impact

  • Impact on user: No
  • Impact on build: No.
  • Impact on hardware: ESP32, ESP32S2, ESP32S3, ESP32C3, ESP32C6 and ESP32H2.
  • Impact on documentation: No.
  • Impact on security: No.
  • Impact on compatibility: No.

Testing

Extensive test has been done on all SoCs using Espressif's internal CI for the past weeks.

For each board, we build and test all defconfigs. The SoCs that have QEMU support also have QEMU testing.
Additionally, we test combinations of MCUBoot + many defconfigs, including radio capabilities.

The toolchain used for Xtensa was the 14.2.0. That has been updated on NuttX's CI (#16643).

Since it affects many areas, I'll share a test report summary for our boards. It shows some but not all tests.

esp32c3-generic_results.txt
esp32s3-lcd-ev_results.txt
esp32c6-devkitc_results.txt
esp32s3-devkit_results.txt
esp32s2-saola-1_results.txt
esp32-ethernet-kit_results.txt
esp32-devkitc_results.txt

Results

CI is passing as expected with the following exception:

@github-actions github-actions bot added Area: Tooling Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: xtensa Issues related to the Xtensa architecture Board: risc-v Board: xtensa Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Jun 27, 2025
@tmedicci tmedicci requested a review from Copilot June 27, 2025 17:42
tmedicci
tmedicci previously approved these changes Jun 27, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates and refactors the lower-half drivers for multiple Espressif SoCs on both RISC-V and Xtensa architectures. The key goals are to support new ESP32-C3/C6/H2 devices and streamline existing code.

  • Insert application description (.rodata_desc) as the first item in flash .rodata across all ESP linker scripts
  • Refactor and remove legacy Wi-Fi adapter event queue code, replacing it with esp_event_post wrappers
  • Update HAL Makefiles and submodule configurations to include new ESP-HAL components and correct write-flash options

Reviewed Changes

Copilot reviewed 100 out of 100 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/espressif/Config.mk Corrected write_flash option ordering when merging bins
boards/xtensa/…/legacy_sections.ld Added esp_app_desc to legacy .text sections
boards/xtensa/…/kernel-space.ld Inserted reserved rodata start and .rodata_desc in kernel
boards/xtensa/…/esp32s3_sections.ld Inserted reserved rodata start and .rodata_desc for ESP32S3
arch/xtensa/src/esp32s3/hal.mk Added missing HAL include paths for LDO, MSPI, power, etc.
arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.h Removed obsolete Wi-Fi preprocessor blocks
arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c Replaced legacy event handling with esp_event_post_wrapper
arch/xtensa/src/esp32s3/esp32s3_start.c Added esp_app_get_description() magic-word check
Comments suppressed due to low confidence (2)

tools/espressif/Config.mk:166

  • The if branch for CONFIG_ESPRESSIF_MERGE_BINS now prepends $(ESPTOOL_WRITEFLASH_OPTS) incorrectly, causing extra flags before the merge address. Swap the order so that 0x0 nuttx.merged.bin comes first as before.
	$(eval WRITEFLASH_OPTS := $(if $(CONFIG_ESPRESSIF_MERGE_BINS),$(ESPTOOL_WRITEFLASH_OPTS) 0x0 nuttx.merged.bin,$(ESPTOOL_WRITEFLASH_OPTS) $(ESPTOOL_BINS)))

boards/xtensa/esp32/common/scripts/kernel-space.ld:256

  • Missing newline between the two assignments can lead to linker script syntax errors. Split into two separate lines:
    _srodata = ABSOLUTE(.);_rodata_reserved_start = ABSOLUTE(.);

@fdcavalcanti fdcavalcanti dismissed stale reviews from xiaoxiang781216 and tmedicci via 89bc00a June 30, 2025 11:38
@fdcavalcanti fdcavalcanti force-pushed the feature/espressif-upgrade-rc3 branch from a9f2c34 to 89bc00a Compare June 30, 2025 11:38
@xiaoxiang781216 xiaoxiang781216 merged commit e57d2a5 into apache:master Jun 30, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: xtensa Issues related to the Xtensa architecture Area: Tooling Board: risc-v Board: xtensa Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Failing QEMU tests after #16499

6 participants