This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 4f40f6135dfbfa979d759404c103293a8f14ebdc
Author: Arjav Patel <[email protected]>
AuthorDate: Fri May 1 09:07:57 2026 +0530

    arch,boards/risc-v/espressif: Enable CMake path for esp32c3-legacy.
    
    Add esp32c3-legacy architecture CMake entry points and representative
    board/common CMake files so legacy ESP32-C3 targets can be built through
    the same CMake flow used by modern Espressif RISC-V targets.
    
    Signed-off-by: Arjav Patel <[email protected]>
---
 arch/risc-v/src/esp32c3-legacy/CMakeLists.txt      | 44 ++++++++++++++++++++++
 .../src/esp32c3-legacy/hal_esp32c3-legacy.cmake    |  8 ++++
 boards/risc-v/esp32c3-legacy/common/CMakeLists.txt |  8 ++++
 .../esp32c3-legacy/common/src/CMakeLists.txt       | 24 ++++++++++++
 .../esp32c3-legacy-devkit/CMakeLists.txt           | 11 ++++++
 .../esp32c3-legacy-devkit/src/CMakeLists.txt       | 20 ++++++++++
 6 files changed, 115 insertions(+)

diff --git a/arch/risc-v/src/esp32c3-legacy/CMakeLists.txt 
b/arch/risc-v/src/esp32c3-legacy/CMakeLists.txt
new file mode 100644
index 00000000000..f7eb2ade07f
--- /dev/null
+++ b/arch/risc-v/src/esp32c3-legacy/CMakeLists.txt
@@ -0,0 +1,44 @@
+# 
##############################################################################
+# arch/risc-v/src/esp32c3-legacy/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common/espressif espressif)
+
+set(SRCS
+    esp32c3_head.S
+    esp32c3_vectors.S
+    esp32c3_allocateheap.c
+    esp32c3_start.c
+    esp32c3_wdt.c
+    esp32c3_idle.c
+    esp32c3_irq.c
+    esp32c3_libc_stubs.c
+    esp32c3_clockconfig.c
+    esp32c3_gpio.c
+    esp32c3_rtc_gpio.c
+    esp32c3_lowputc.c
+    esp32c3_serial.c
+    esp32c3_systemreset.c
+    esp32c3_resetcause.c
+    esp32c3_uid.c
+    esp32c3_perf.c
+    esp32c3_rtc.c)
+
+if(CONFIG_SCHED_TICKLESS)
+  list(APPEND SRCS esp32c3_tickless.c)
+else()
+  list(APPEND SRCS esp32c3_timerisr.c)
+endif()
+
+if(CONFIG_ESPRESSIF_WIFI)
+  list(APPEND SRCS esp32c3_wifi_adapter.c)
+endif()
+
+if(CONFIG_ESPRESSIF_BLE)
+  list(APPEND SRCS esp32c3_ble_adapter.c esp32c3_ble.c)
+endif()
+
+target_compile_definitions(arch PRIVATE _RETARGETABLE_LOCKING)
+target_sources(arch PRIVATE ${SRCS})
diff --git a/arch/risc-v/src/esp32c3-legacy/hal_esp32c3-legacy.cmake 
b/arch/risc-v/src/esp32c3-legacy/hal_esp32c3-legacy.cmake
new file mode 100644
index 00000000000..425150174d4
--- /dev/null
+++ b/arch/risc-v/src/esp32c3-legacy/hal_esp32c3-legacy.cmake
@@ -0,0 +1,8 @@
+# 
##############################################################################
+# arch/risc-v/src/esp32c3-legacy/hal_esp32c3-legacy.cmake
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(CHIP_SERIES esp32c3)
+include(${NUTTX_ARCH_ABS_DIR}/src/esp32c3/hal_esp32c3.cmake)
diff --git a/boards/risc-v/esp32c3-legacy/common/CMakeLists.txt 
b/boards/risc-v/esp32c3-legacy/common/CMakeLists.txt
new file mode 100644
index 00000000000..63ef1a7b931
--- /dev/null
+++ b/boards/risc-v/esp32c3-legacy/common/CMakeLists.txt
@@ -0,0 +1,8 @@
+# 
##############################################################################
+# boards/risc-v/esp32c3-legacy/common/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+add_subdirectory(src)
+target_include_directories(board PRIVATE include)
diff --git a/boards/risc-v/esp32c3-legacy/common/src/CMakeLists.txt 
b/boards/risc-v/esp32c3-legacy/common/src/CMakeLists.txt
new file mode 100644
index 00000000000..e8bf275b6b0
--- /dev/null
+++ b/boards/risc-v/esp32c3-legacy/common/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+# 
##############################################################################
+# boards/risc-v/esp32c3-legacy/common/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS)
+
+if(CONFIG_ARCH_BOARD_COMMON)
+  if(CONFIG_ESP32C3_SPI)
+    list(APPEND SRCS esp32c3_board_spi.c)
+  endif()
+  if(CONFIG_SPI_DRIVER)
+    list(APPEND SRCS esp32c3_board_spidev.c)
+  endif()
+  if(CONFIG_SPI_SLAVE_DRIVER)
+    list(APPEND SRCS esp32c3_board_spislavedev.c)
+  endif()
+  if(CONFIG_WATCHDOG)
+    list(APPEND SRCS esp32c3_board_wdt.c)
+  endif()
+endif()
+
+target_sources(board PRIVATE ${SRCS})
diff --git a/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/CMakeLists.txt 
b/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/CMakeLists.txt
new file mode 100644
index 00000000000..d1fe00fdfba
--- /dev/null
+++ b/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 
##############################################################################
+# boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../common/CMakeLists.txt")
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common common)
+endif()
+
+add_subdirectory(src)
diff --git 
a/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/CMakeLists.txt 
b/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/CMakeLists.txt
new file mode 100644
index 00000000000..9a68705dd01
--- /dev/null
+++ b/boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/CMakeLists.txt
@@ -0,0 +1,20 @@
+# 
##############################################################################
+# boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+# 
##############################################################################
+
+set(SRCS esp32c3_boot.c esp32c3_bringup.c)
+
+if(CONFIG_BOARDCTL)
+  list(APPEND SRCS esp32c3_appinit.c)
+  if(CONFIG_BOARDCTL_RESET)
+    list(APPEND SRCS esp32c3_reset.c)
+  endif()
+endif()
+
+if(CONFIG_DEV_GPIO)
+  list(APPEND SRCS esp32c3_gpio.c)
+endif()
+
+target_sources(board PRIVATE ${SRCS})

Reply via email to