Skip to content

Add ESP32-C2 (ESP8684) chip support - #20155

Draft
wmrsouza wants to merge 13 commits into
apache:masterfrom
wmrsouza:port/esp32c2
Draft

wmrsouza wants to merge 13 commits into
apache:masterfrom
wmrsouza:port/esp32c2

Conversation

@wmrsouza

@wmrsouza wmrsouza commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds ESP32-C2 chip support on NuttX

Impact

Impact on user: No.

Impact on hardware: No.

Impact on documentation: No.

Impact on compatibility: No.

Testing

make distclean && ./tools/configure.sh -S esp8684-devkitm:nsh && make -j && make flash ESPTOOL_PORT=/dev/ttyUSB0 && picocom -b 115200 /dev/ttyUSB0

@acassis acassis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wmrsouza please submit the Documentation to this arch and to the board. You can use Documentation/contributing/doc_templates/board.rst for board

@acassis

acassis commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@wmrsouza please also add the Assisted-by: LLM Vendor / Model used

@github-actions github-actions Bot added Area: Build system Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: risc-v labels Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@wmrsouza
wmrsouza force-pushed the port/esp32c2 branch 5 times, most recently from 4e4cb54 to 89b9568 Compare September 16, 2026 16:18
@wmrsouza
wmrsouza marked this pull request as ready for review September 16, 2026 16:40
@acassis
acassis marked this pull request as draft September 16, 2026 16:54
@acassis

acassis commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@wmrsouza let's keep it as draft until you fix the reviewing

I think the first two commit aren't related to the initial port, since the are generic:

arch/risc-v/espressif: add line-fitting ADC calibration

arch/risc-v/espressif: pick oneshot TIMG from SoC instance count

@wmrsouza
wmrsouza force-pushed the port/esp32c2 branch 2 times, most recently from d7d5676 to b1cee77 Compare September 16, 2026 20:16
@acassis

acassis commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@wmrsouza please read (or ask your AI agent to read it): https://nuttx.apache.org/docs/latest/contributing/guide.html

We don't use: Co-authored-by: Cursor cursoragent@cursor.com and you forgot to add your Signed-off-by. Please use git rebase and fix it on all commits.

@wmrsouza

wmrsouza commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @acassis I'll be addressing these issues as soon as possible.

Some SoCs have a single timer group, so a hardcoded GROUP_ID of 1
overflowed soc_timg_gptimer_signals and crashed in
periph_rcc_acquire_enter. Guard gptimer group 1 behind
TIMG_LL_GET(INST_NUM) as well.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
wmrsouza and others added 12 commits September 18, 2026 16:59
SoCs such as the ESP32-C2 have no RTC retention memory, so RTC_DATA_ATTR
cannot be used for the persistent RTC time.  Place the backup data in DRAM
on those chips, where the saved time does not survive deep sleep.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Introduce RV32IMC chip architecture with HAL integration and Espressif
common Kconfig for the ESP8684 SoC, including XTAL, UART0 pin range,
and SPI flash clock options.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add linker scripts and shared board drivers reused by ESP32-C2 boards,
and wire common Kconfig into the board configuration tree.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add NSH bringup for the Espressif ESP8684-DevKitM. The nsh defconfig
uses a 26 MHz XTAL, 4 MB flash, and debug features for the MINI-1 module.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add ADC, I2C, LEDC, SPI, SPI flash, MMCSD and RNG helpers used by
the ESP32-C2 board bring-up.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add GPIO, buttons, and defconfigs/bring-up for ADC, I2C, PWM, SPI,
timers, watchdog, eFuse, crypto, RTC, and related C2 peripherals.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add BMP180/BMP280 helpers and ROMFS init scripts used by non-SoC
board features.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add BMP180, ROMFS, MCUBoot NSH, ostest, tickless, and power-management
defconfigs plus the matching bring-up hooks.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Bring in Wi-Fi, BLE, coexistence, and wireless glue for the ESP32-C2 radio.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add the Wi-Fi board helper, wifi and ble defconfigs, and BLE bring-up for
the ESP32-C2 radio.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Document the chip (toolchain, Simple Boot, peripherals, MCUBoot) and
the DevKitM-1 board (pinout, headers, RGB, existing defconfigs),
including vendor figures.

Assisted-by: Cursor:Grok 4.6
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
ESP32-C2 only supports UART active-edge wakeup like C3, and the HAL
has no sleep_cpu port, so autopm needs a no-op sleep_cpu_configure().

Co-authored-by: Cursor <cursoragent@cursor.com>
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 Area: Build system Board: risc-v 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.

2 participants