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 2e96bbdaa9c0f186cc9185e5a65f9ab759b662c4
Author: Max Kriegleder <[email protected]>
AuthorDate: Thu Oct 29 17:54:49 2026 +0100

    boards/xtensa/esp32*: Complete the CMake build of the ESP32 boards.
    
    * esp32s3, esp32, esp32s2 common: the linker scripts of the boards'
      scripts/Make.defs, all common sources, the /etc ROMFS (with the board's
      etc/txtable.txt for TXTABLE_PARTITION), the board's src directory on the
      include path.
    * esp32s3-devkit, esp32-devkitc, esp32s2-saola-1: the sources of their
      Make.defs (esp32s3_appinit.c no longer exists); do not add ../common a
      second time (boards/CMakeLists.txt does).
    * esp32s2-saola-1: -fno-omit-frame-pointer with DEBUG_FULLOPT, as its
      Make.defs.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Max Kriegleder <[email protected]>
---
 boards/xtensa/esp32/common/CMakeLists.txt          |  16 ++++
 boards/xtensa/esp32/common/src/CMakeLists.txt      | 106 +++++++++++++++++++++
 boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt   |   4 -
 .../xtensa/esp32/esp32-devkitc/src/CMakeLists.txt  |  25 +++--
 boards/xtensa/esp32s2/common/CMakeLists.txt        |  10 ++
 boards/xtensa/esp32s2/common/src/CMakeLists.txt    |  69 ++++++++++++++
 .../xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt  |   4 -
 .../esp32s2/esp32s2-saola-1/cmake/Toolchain.cmake  |  27 ++++++
 .../esp32s2/esp32s2-saola-1/src/CMakeLists.txt     |  24 +++--
 boards/xtensa/esp32s3/common/CMakeLists.txt        |  21 ++++
 boards/xtensa/esp32s3/common/src/CMakeLists.txt    |  80 ++++++++++++++++
 .../xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt   |   4 -
 .../esp32s3/esp32s3-devkit/src/CMakeLists.txt      |  31 ++++--
 13 files changed, 387 insertions(+), 34 deletions(-)

diff --git a/boards/xtensa/esp32/common/CMakeLists.txt 
b/boards/xtensa/esp32/common/CMakeLists.txt
index ba878244faa..e0b48d3646a 100644
--- a/boards/xtensa/esp32/common/CMakeLists.txt
+++ b/boards/xtensa/esp32/common/CMakeLists.txt
@@ -6,3 +6,19 @@
 
 add_subdirectory(src)
 target_include_directories(board PRIVATE include)
+
+# Linker scripts, as the boards' scripts/Make.defs
+
+if(CONFIG_BUILD_PROTECTED)
+  set(LDSCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/protected_memory.ld
+                ${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel-space.ld)
+else()
+  set(LDSCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/flat_memory.ld
+                ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32_sections.ld)
+endif()
+
+set_property(GLOBAL APPEND PROPERTY LD_SCRIPT ${LDSCRIPTS})
+
+if(CONFIG_ESP32_APP_FORMAT_LEGACY)
+  target_link_options(nuttx PRIVATE "SHELL:-u esp_app_desc")
+endif()
diff --git a/boards/xtensa/esp32/common/src/CMakeLists.txt 
b/boards/xtensa/esp32/common/src/CMakeLists.txt
index 5985ba3c4db..4168d3646c7 100644
--- a/boards/xtensa/esp32/common/src/CMakeLists.txt
+++ b/boards/xtensa/esp32/common/src/CMakeLists.txt
@@ -13,9 +13,30 @@ if(CONFIG_ARCH_BOARD_COMMON)
   if(CONFIG_ESPRESSIF_ADC)
     list(APPEND SRCS esp32_board_adc.c)
   endif()
+  if(CONFIG_ONESHOT)
+    list(APPEND SRCS esp32_oneshot.c)
+  endif()
   if(CONFIG_ESP32_I2C)
     list(APPEND SRCS esp32_board_i2c.c)
   endif()
+  if(CONFIG_ESPRESSIF_I2S)
+    list(APPEND SRCS esp32_board_i2sdev.c)
+  endif()
+  if(CONFIG_ESP_PCNT)
+    list(APPEND SRCS esp32_board_pcnt.c)
+  endif()
+  if(CONFIG_SENSORS_MAX6675)
+    list(APPEND SRCS esp32_max6675.c)
+  endif()
+  if(CONFIG_AUDIO_CS4344)
+    list(APPEND SRCS esp32_cs4344.c)
+  endif()
+  if(CONFIG_AUDIO_ES8388)
+    list(APPEND SRCS esp32_es8388.c)
+  endif()
+  if(CONFIG_I2CMULTIPLEXER_TCA9548A)
+    list(APPEND SRCS esp32_tca9548a.c)
+  endif()
   if(CONFIG_ESP32_SPI)
     list(APPEND SRCS esp32_board_spi.c)
   endif()
@@ -31,6 +52,91 @@ if(CONFIG_ARCH_BOARD_COMMON)
   if(CONFIG_ESPRESSIF_WIFI)
     list(APPEND SRCS esp32_board_wlan.c)
   endif()
+  if(CONFIG_SENSORS_APDS9960)
+    list(APPEND SRCS esp32_board_apds9960.c)
+  endif()
+  if(CONFIG_SENSORS_BMP180)
+    list(APPEND SRCS esp32_bmp180.c)
+  endif()
+  if(CONFIG_SENSORS_BMP280)
+    list(APPEND SRCS esp32_bmp280.c)
+  endif()
+  if(CONFIG_SENSORS_BME680)
+    list(APPEND SRCS esp32_bme680.c)
+  endif()
+  if(CONFIG_SENSORS_SHT3X)
+    list(APPEND SRCS esp32_sht3x.c)
+  endif()
+  if(CONFIG_SENSORS_MS56XX)
+    list(APPEND SRCS esp32_ms5611.c)
+  endif()
+  if(CONFIG_SENSORS_LTR308)
+    list(APPEND SRCS esp32_ltr308.c)
+  endif()
+  if(CONFIG_LCD_HT16K33)
+    list(APPEND SRCS esp32_ht16k33.c)
+  endif()
+  if(CONFIG_CAN_MCP2515)
+    list(APPEND SRCS esp32_mcp2515.c)
+  endif()
+  if(CONFIG_LCD_BACKPACK)
+    list(APPEND SRCS esp32_lcd_backpack.c)
+  endif()
+  if(CONFIG_LCD_DEV)
+    list(APPEND SRCS esp32_backlight.c)
+  endif()
+  if(CONFIG_LCD_ILI9341)
+    list(APPEND SRCS esp32_ili9341.c)
+  endif()
+  if(CONFIG_LCD_GC9A01)
+    list(APPEND SRCS esp32_gc9a01.c)
+  endif()
+  if(CONFIG_LCD_ST7789)
+    list(APPEND SRCS esp32_st7789.c)
+  endif()
+  if(CONFIG_LCD_APA102)
+    list(APPEND SRCS esp32_board_apa102_lcd.c)
+  endif()
+  if(CONFIG_LCD_SSD1306_I2C)
+    list(APPEND SRCS esp32_ssd1306.c)
+  endif()
+  if(CONFIG_LCD_SSD1680)
+    list(APPEND SRCS esp32_ssd1680.c)
+  endif()
+  if(CONFIG_RGBLED)
+    list(APPEND SRCS esp32_rgbled.c)
+  endif()
+  if(CONFIG_ESP_RMT)
+    list(APPEND SRCS esp32_board_rmt.c)
+  endif()
+  list(APPEND SRCS esp32_board_dac.c)
+  if(CONFIG_SENSORS_ZEROCROSS)
+    list(APPEND SRCS esp32_zerocross.c)
+  endif()
+  if(CONFIG_ESP_MCPWM)
+    list(APPEND SRCS esp32_board_mcpwm.c)
+  endif()
+  if(CONFIG_MMCSD_SPI)
+    list(APPEND SRCS esp32_board_sdmmc.c)
+  endif()
+
+  if(CONFIG_ETC_ROMFS)
+    nuttx_add_romfs(
+      NAME
+      etc
+      MOUNTPOINT
+      etc
+      RCSRCS
+      etc/init.d/rc.sysinit
+      etc/init.d/rcS
+      PATH
+      ${CMAKE_CURRENT_BINARY_DIR}/etc)
+    target_link_libraries(board PRIVATE romfs_etc)
+  endif()
 endif()
 
+# The board's own headers, as Make's include path (arch/<arch>/src/board/src)
+
+target_include_directories(board PRIVATE ${NUTTX_BOARD_DIR}/src)
+
 target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt 
b/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
index f7e48d6342f..ceabc1d7ba4 100644
--- a/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
+++ b/boards/xtensa/esp32/esp32-devkitc/CMakeLists.txt
@@ -4,8 +4,4 @@
 # 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/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt 
b/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
index 60d286b03dc..ccb0f838033 100644
--- a/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
+++ b/boards/xtensa/esp32/esp32-devkitc/src/CMakeLists.txt
@@ -5,20 +5,29 @@
 # 
##############################################################################
 
 set(SRCS esp32_boot.c esp32_bringup.c)
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS esp32_appinit.c)
-  if(CONFIG_BOARDCTL_RESET)
-    list(APPEND SRCS esp32_reset.c)
-  endif()
+if(CONFIG_BOARDCTL_RESET)
+  list(APPEND SRCS esp32_reset.c)
 endif()
-
 if(CONFIG_DEV_GPIO)
   list(APPEND SRCS esp32_gpio.c)
 endif()
-
+if(CONFIG_PWM)
+  list(APPEND SRCS esp32_ledc.c)
+endif()
+if(CONFIG_USERLED)
+  list(APPEND SRCS esp32_userleds.c)
+endif()
+if(CONFIG_WS2812)
+  list(APPEND SRCS esp32_ws2812.c)
+endif()
 if(CONFIG_ARCH_BUTTONS)
   list(APPEND SRCS esp32_buttons.c)
 endif()
+if(CONFIG_ESP32_TWAI)
+  list(APPEND SRCS esp32_twai.c)
+endif()
+if(CONFIG_NET_W5500)
+  list(APPEND SRCS esp32_w5500.c)
+endif()
 
 target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s2/common/CMakeLists.txt 
b/boards/xtensa/esp32s2/common/CMakeLists.txt
index 4322c68a229..0f5bac5c741 100644
--- a/boards/xtensa/esp32s2/common/CMakeLists.txt
+++ b/boards/xtensa/esp32s2/common/CMakeLists.txt
@@ -6,3 +6,13 @@
 
 add_subdirectory(src)
 target_include_directories(board PRIVATE include)
+
+# Linker scripts, as the boards' scripts/Make.defs
+
+set_property(
+  GLOBAL APPEND
+  PROPERTY LD_SCRIPT
+           ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s2_aliases.ld
+           ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s2_peripherals.ld
+           ${CMAKE_CURRENT_SOURCE_DIR}/scripts/flat_memory.ld
+           ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s2_sections.ld)
diff --git a/boards/xtensa/esp32s2/common/src/CMakeLists.txt 
b/boards/xtensa/esp32s2/common/src/CMakeLists.txt
index 9ab6fe325b1..0213e462be3 100644
--- a/boards/xtensa/esp32s2/common/src/CMakeLists.txt
+++ b/boards/xtensa/esp32s2/common/src/CMakeLists.txt
@@ -19,9 +19,78 @@ if(CONFIG_ARCH_BOARD_COMMON)
   if(CONFIG_SPI_DRIVER)
     list(APPEND SRCS esp32s2_board_spidev.c)
   endif()
+  if(CONFIG_ESPRESSIF_WIFI)
+    list(APPEND SRCS esp32s2_board_wlan.c)
+  endif()
   if(CONFIG_SPI_SLAVE_DRIVER)
     list(APPEND SRCS esp32s2_board_spislavedev.c)
   endif()
+  if(CONFIG_ESPRESSIF_SPIFLASH)
+    list(APPEND SRCS esp32s2_board_spiflash.c)
+  endif()
+  if(CONFIG_SENSORS_MAX6675)
+    list(APPEND SRCS esp32s2_max6675.c)
+  endif()
+  if(CONFIG_ESPRESSIF_I2S)
+    list(APPEND SRCS esp32s2_board_i2sdev.c)
+  endif()
+  if(CONFIG_ESP32S2_TWAI)
+    list(APPEND SRCS esp32s2_board_twai.c)
+  endif()
+  if(CONFIG_AUDIO_CS4344)
+    list(APPEND SRCS esp32s2_cs4344.c)
+  endif()
+  if(CONFIG_LCD_ILI9341)
+    list(APPEND SRCS esp32s2_ili9341.c)
+  endif()
+  if(CONFIG_LCD_ST7789)
+    list(APPEND SRCS esp32s2_st7789.c)
+  endif()
+  if(CONFIG_AUDIO_ES8311)
+    list(APPEND SRCS esp32s2_es8311.c)
+  endif()
+  if(CONFIG_ESP_RMT)
+    list(APPEND SRCS esp32s2_board_rmt.c)
+  endif()
+  if(CONFIG_ESP_PCNT)
+    list(APPEND SRCS esp32s2_board_pcnt.c)
+  endif()
+  if(CONFIG_MMCSD_SPI)
+    list(APPEND SRCS esp32s2_board_sdmmc.c)
+  endif()
+
+  if(CONFIG_ESP32S2_TWAI
+     OR CONFIG_ARCH_BUTTONS
+     OR CONFIG_DEV_GPIO)
+    string(REPLACE "\"" "" CHIP_SERIES "${CONFIG_ESPRESSIF_CHIP_SERIES}")
+    set(CHIPHALDIR
+        ${NUTTX_BINARY_DIR}/arch/xtensa/src/common/espressif/esp-hal-3rdparty)
+    target_compile_options(board PRIVATE -Wno-undef)
+    target_include_directories(
+      board
+      PRIVATE ${CHIPHALDIR}/nuttx/${CHIP_SERIES}/include
+              ${CHIPHALDIR}/components/esp_common/include
+              ${CHIPHALDIR}/components/soc/${CHIP_SERIES}/include
+              ${CHIPHALDIR}/components/soc/${CHIP_SERIES}/register)
+  endif()
+
+  if(CONFIG_ETC_ROMFS)
+    nuttx_add_romfs(
+      NAME
+      etc
+      MOUNTPOINT
+      etc
+      RCSRCS
+      etc/init.d/rc.sysinit
+      etc/init.d/rcS
+      PATH
+      ${CMAKE_CURRENT_BINARY_DIR}/etc)
+    target_link_libraries(board PRIVATE romfs_etc)
+  endif()
 endif()
 
+# The board's own headers, as Make's include path (arch/<arch>/src/board/src)
+
+target_include_directories(board PRIVATE ${NUTTX_BOARD_DIR}/src)
+
 target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt 
b/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
index 071f0a9f4b8..60064346348 100644
--- a/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/CMakeLists.txt
@@ -4,8 +4,4 @@
 # 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/xtensa/esp32s2/esp32s2-saola-1/cmake/Toolchain.cmake 
b/boards/xtensa/esp32s2/esp32s2-saola-1/cmake/Toolchain.cmake
new file mode 100644
index 00000000000..17f5bf8b3a1
--- /dev/null
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/cmake/Toolchain.cmake
@@ -0,0 +1,27 @@
+# 
##############################################################################
+# boards/xtensa/esp32s2/esp32s2-saola-1/cmake/Toolchain.cmake
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+# license agreements.  See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership.  The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may 
not
+# use this file except in compliance with the License.  You may obtain a copy 
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+# 
##############################################################################
+
+# As the board's scripts/Make.defs
+
+if(CONFIG_DEBUG_FULLOPT)
+  add_compile_options(-fno-omit-frame-pointer)
+endif()
diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt 
b/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
index 156c0b6e146..60c8ce39a0f 100644
--- a/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/src/CMakeLists.txt
@@ -5,16 +5,26 @@
 # 
##############################################################################
 
 set(SRCS esp32s2_boot.c esp32s2_bringup.c)
-
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS esp32s2_appinit.c)
-  if(CONFIG_BOARDCTL_RESET)
-    list(APPEND SRCS esp32s2_reset.c)
-  endif()
+if(CONFIG_BOARDCTL_RESET)
+  list(APPEND SRCS esp32s2_reset.c)
 endif()
-
 if(CONFIG_DEV_GPIO)
   list(APPEND SRCS esp32s2_gpio.c)
 endif()
+if(CONFIG_PWM)
+  list(APPEND SRCS esp32s2_ledc.c)
+endif()
+if(CONFIG_ONESHOT)
+  list(APPEND SRCS esp32s2_oneshot.c)
+endif()
+if(CONFIG_I2C_DRIVER)
+  list(APPEND SRCS esp32s2_board_i2c.c)
+endif()
+if(CONFIG_SENSORS_BMP180)
+  list(APPEND SRCS esp32s2_bmp180.c)
+endif()
+if(CONFIG_ARCH_BUTTONS)
+  list(APPEND SRCS esp32s2_buttons.c)
+endif()
 
 target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s3/common/CMakeLists.txt 
b/boards/xtensa/esp32s3/common/CMakeLists.txt
index 4b97755ce5d..30006dd50ed 100644
--- a/boards/xtensa/esp32s3/common/CMakeLists.txt
+++ b/boards/xtensa/esp32s3/common/CMakeLists.txt
@@ -6,3 +6,24 @@
 
 add_subdirectory(src)
 target_include_directories(board PRIVATE include)
+
+# Linker scripts, as the boards' scripts/Make.defs
+
+set(LDSCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s3_peripherals.ld
+              ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s3_rom_aliases.ld)
+
+if(CONFIG_BUILD_PROTECTED)
+  list(APPEND LDSCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/protected_memory.ld
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/kernel-space.ld)
+else()
+  list(APPEND LDSCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/flat_memory.ld)
+  if(CONFIG_ESP32S3_APP_FORMAT_LEGACY)
+    list(APPEND LDSCRIPTS
+         ${CMAKE_CURRENT_SOURCE_DIR}/scripts/legacy_sections.ld)
+  else()
+    list(APPEND LDSCRIPTS
+         ${CMAKE_CURRENT_SOURCE_DIR}/scripts/esp32s3_sections.ld)
+  endif()
+endif()
+
+set_property(GLOBAL APPEND PROPERTY LD_SCRIPT ${LDSCRIPTS})
diff --git a/boards/xtensa/esp32s3/common/src/CMakeLists.txt 
b/boards/xtensa/esp32s3/common/src/CMakeLists.txt
index 83f39a59462..581888c55fc 100644
--- a/boards/xtensa/esp32s3/common/src/CMakeLists.txt
+++ b/boards/xtensa/esp32s3/common/src/CMakeLists.txt
@@ -19,6 +19,86 @@ if(CONFIG_ARCH_BOARD_COMMON)
   if(CONFIG_SPI_DRIVER)
     list(APPEND SRCS esp32s3_board_spidev.c)
   endif()
+  if(CONFIG_SPI_SLAVE_DRIVER)
+    list(APPEND SRCS esp32s3_board_spislavedev.c)
+  endif()
+  if(CONFIG_ESPRESSIF_WIFI)
+    list(APPEND SRCS esp32s3_board_wlan.c)
+  endif()
+  if(CONFIG_I2C_DRIVER)
+    list(APPEND SRCS esp32s3_board_i2c.c)
+  endif()
+  if(CONFIG_ESPRESSIF_I2S)
+    list(APPEND SRCS esp32s3_board_i2s.c)
+  endif()
+  if(CONFIG_AUDIO_CS4344)
+    list(APPEND SRCS esp32s3_cs4344.c)
+  endif()
+  if(CONFIG_AUDIO_ES8311)
+    list(APPEND SRCS esp32s3_es8311.c)
+  endif()
+  if(CONFIG_SENSORS_BMP180)
+    list(APPEND SRCS esp32s3_board_bmp180.c)
+  endif()
+  if(CONFIG_SENSORS_LSM6DS3TRC)
+    list(APPEND SRCS esp32s3_board_lsm6ds3trc.c)
+  endif()
+  if(CONFIG_ESP32S3_OTG)
+    list(APPEND SRCS esp32s3_board_usb.c)
+  endif()
+  if(CONFIG_ESPRESSIF_ADC)
+    list(APPEND SRCS esp32s3_board_adc.c)
+  endif()
+  if(CONFIG_SENSORS_QMI8658)
+    list(APPEND SRCS esp32s3_qmi8658.c)
+  endif()
+  if(CONFIG_NET_LAN9250)
+    list(APPEND SRCS esp32s3_lan9250.c)
+  endif()
+  if(CONFIG_ESP_PCNT)
+    list(APPEND SRCS esp32s3_board_pcnt.c)
+  endif()
+  if(CONFIG_ESP_RMT)
+    list(APPEND SRCS esp32s3_board_rmt.c)
+  endif()
+  if(CONFIG_ESP_MCPWM)
+    list(APPEND SRCS esp32s3_board_mcpwm.c)
+  endif()
+  if(CONFIG_MMCSD_SPI OR CONFIG_ESP32S3_SDMMC)
+    list(APPEND SRCS esp32s3_board_sdmmc.c)
+  endif()
+  if(CONFIG_USBMSC)
+    list(APPEND SRCS esp32s3_usbmsc.c)
+  endif()
+  if(CONFIG_ESPRESSIF_LEDC)
+    list(APPEND SRCS esp32s3_board_ledc.c)
+  endif()
+
+  if(CONFIG_ETC_ROMFS)
+    set(RCSRCS etc/init.d/rc.sysinit etc/init.d/rcS)
+    if(CONFIG_SYSTEM_NXINIT)
+      list(APPEND RCSRCS etc/init.d/init.rc)
+    endif()
+    if(CONFIG_TXTABLE_PARTITION)
+      set(RCRAWS ${NUTTX_BOARD_DIR}/src/etc/txtable.txt)
+    endif()
+    nuttx_add_romfs(
+      NAME
+      etc
+      MOUNTPOINT
+      etc
+      RCSRCS
+      ${RCSRCS}
+      RCRAWS
+      ${RCRAWS}
+      PATH
+      ${CMAKE_CURRENT_BINARY_DIR}/etc)
+    target_link_libraries(board PRIVATE romfs_etc)
+  endif()
 endif()
 
+# The board's own headers, as Make's include path (arch/<arch>/src/board/src)
+
+target_include_directories(board PRIVATE ${NUTTX_BOARD_DIR}/src)
+
 target_sources(board PRIVATE ${SRCS})
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt 
b/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
index 95faf689131..f692b8fd3b0 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/CMakeLists.txt
@@ -4,8 +4,4 @@
 # 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/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt 
b/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
index 2fd6058846d..3962c6d94bf 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/src/CMakeLists.txt
@@ -6,19 +6,36 @@
 
 set(SRCS esp32s3_boot.c esp32s3_bringup.c)
 
-if(CONFIG_BOARDCTL)
-  list(APPEND SRCS esp32s3_appinit.c)
-  if(CONFIG_BOARDCTL_RESET)
-    list(APPEND SRCS esp32s3_reset.c)
-  endif()
+if(CONFIG_BUILD_KERNEL)
+  list(APPEND SRCS romfs_stub.c)
 endif()
 
-if(CONFIG_DEV_GPIO)
-  list(APPEND SRCS esp32s3_gpio.c)
+if(CONFIG_BOARDCTL_RESET)
+  list(APPEND SRCS esp32s3_reset.c)
 endif()
 
 if(CONFIG_ARCH_BUTTONS)
   list(APPEND SRCS esp32s3_buttons.c)
 endif()
 
+if(CONFIG_INPUT_DJOYSTICK)
+  list(APPEND SRCS esp32s3_djoystick.c)
+endif()
+
+if(CONFIG_ESP32S3_SPI)
+  list(APPEND SRCS esp32s3_board_spi.c)
+endif()
+
+if(CONFIG_ESP32S3_TWAI)
+  list(APPEND SRCS esp32s3_twai.c)
+endif()
+
+if(CONFIG_DEV_GPIO)
+  list(APPEND SRCS esp32s3_gpio.c)
+endif()
+
+if(CONFIG_LCD_ST7735)
+  list(APPEND SRCS esp32s3_st7735.c)
+endif()
+
 target_sources(board PRIVATE ${SRCS})

Reply via email to