boards/xtensa: add support for init script on ESP32-S2|S3

Adds support for init script on ESP32 and ESP32-S2.
Moves the scripts of ESP32-S3 from board specific to
board common (they are the same).

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
This commit is contained in:
Filipe Cavalcanti 2025-09-12 14:28:19 -03:00 committed by Alan C. Assis
parent a729534e52
commit eb00c1317d
17 changed files with 212 additions and 71 deletions

View file

@ -174,6 +174,10 @@ ifeq ($(CONFIG_MMCSD_SPI),y)
CSRCS += esp32_board_sdmmc.c
endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
endif
DEPPATH += --dep-path src
VPATH += :src
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

View file

@ -1,5 +1,5 @@
/****************************************************************************
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rcS
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
*
* SPDX-License-Identifier: Apache-2.0
*
@ -22,10 +22,6 @@
#include <nuttx/config.h>
#ifdef CONFIG_SYSTEM_ADBD
adbd &
#endif
/* This script "rc.sysinit" is executed after the board bring up. */
#ifdef CONFIG_SYSTEM_FASTBOOTD
fastbootd &
#endif
echo "rc.sysinit is called!"

View file

@ -1,5 +1,5 @@
/****************************************************************************
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rc.sysinit
* boards/xtensa/esp32/common/src/etc/init.d/rcS
*
* SPDX-License-Identifier: Apache-2.0
*
@ -22,3 +22,8 @@
#include <nuttx/config.h>
/* This script "rcS" is executed after the rc.sysinit script.
* It should startup some application and other system service.
*/
echo "rcS file is called!"

View file

@ -0,0 +1,48 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="xtensa"
CONFIG_ARCH_BOARD="esp32-devkitc"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
CONFIG_ARCH_CHIP="esp32"
CONFIG_ARCH_CHIP_ESP32=y
CONFIG_ARCH_CHIP_ESP32WROVER=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_ESP32_UART0=y
CONFIG_ETC_ROMFS=y
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=3072
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LINE_MAX=64
CONFIG_MM_REGIONS=3
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSTEM_NSH=y
CONFIG_UART0_SERIAL_CONSOLE=y

View file

@ -99,6 +99,10 @@ ifeq ($(CONFIG_ESP32S2_TWAI)$(CONFIG_ARCH_BUTTONS),y)
CFLAGS += ${INCDIR_PREFIX}$(CHIPHALDIR)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)include
endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
endif
DEPPATH += --dep-path src
VPATH += :src
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

View file

@ -1,5 +1,5 @@
/****************************************************************************
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rcS
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
*
* SPDX-License-Identifier: Apache-2.0
*
@ -22,10 +22,6 @@
#include <nuttx/config.h>
#ifdef CONFIG_SYSTEM_ADBD
adbd &
#endif
/* This script "rc.sysinit" is executed after the board bring up. */
#ifdef CONFIG_SYSTEM_FASTBOOTD
fastbootd &
#endif
echo "rc.sysinit is called!"

View file

@ -0,0 +1,29 @@
/****************************************************************************
* boards/xtensa/esp32/common/src/etc/init.d/rcS
*
* 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.
*
****************************************************************************/
#include <nuttx/config.h>
/* This script "rcS" is executed after the rc.sysinit script.
* It should startup some application and other system service.
*/
echo "rcS file is called!"

View file

@ -0,0 +1,47 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="xtensa"
CONFIG_ARCH_BOARD="esp32s2-saola-1"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32S2_SAOLA_1=y
CONFIG_ARCH_CHIP="esp32s2"
CONFIG_ARCH_CHIP_ESP32S2=y
CONFIG_ARCH_CHIP_ESP32S2WROVER=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_ESP32S2_UART0=y
CONFIG_ETC_ROMFS=y
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=3072
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LINE_MAX=64
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSTEM_NSH=y
CONFIG_UART0_SERIAL_CONSOLE=y

View file

@ -106,6 +106,13 @@ ifeq ($(CONFIG_ESPRESSIF_LEDC),y)
CSRCS += esp32s3_board_ledc.c
endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
RCRAWS = etc/txtable.txt
endif
endif
DEPPATH += --dep-path src
VPATH += :src
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

View file

@ -1,5 +1,5 @@
/****************************************************************************
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rc.sysinit
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
*
* SPDX-License-Identifier: Apache-2.0
*
@ -22,3 +22,6 @@
#include <nuttx/config.h>
/* This script "rc.sysinit" is executed after the board bring up. */
echo "rc.sysinit is called!"

View file

@ -1,5 +1,5 @@
/****************************************************************************
* boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS
* boards/xtensa/esp32/common/src/etc/init.d/rcS
*
* SPDX-License-Identifier: Apache-2.0
*
@ -22,6 +22,12 @@
#include <nuttx/config.h>
/* This script "rcS" is executed after the rc.sysinit script.
* It should startup some application and other system service.
*/
echo "rcS file is called!"
#ifdef CONFIG_SYSTEM_ADBD
adbd &
#endif
@ -29,7 +35,3 @@ adbd &
#ifdef CONFIG_SYSTEM_FASTBOOTD
fastbootd &
#endif
#ifdef CONFIG_EXAMPLES_LVGLDEMO
lvgldemo widgets &
#endif

View file

@ -52,11 +52,3 @@ endif
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
RCRAWS = etc/txtable.txt
endif # CONFIG_TXTABLE_PARTITION
endif

View file

@ -1,2 +0,0 @@
TXTABLE0
data 0x100000 0

View file

@ -0,0 +1,50 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="xtensa"
CONFIG_ARCH_BOARD="esp32s3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32S3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32s3"
CONFIG_ARCH_CHIP_ESP32S3=y
CONFIG_ARCH_CHIP_ESP32S3WROOM1N4=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_ESP32S3_UART0=y
CONFIG_ETC_ROMFS=y
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=3072
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=3072
CONFIG_INTELHEX_BINARY=y
CONFIG_LINE_MAX=64
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSTEM_NSH=y
CONFIG_UART0_SERIAL_CONSOLE=y

View file

@ -56,11 +56,3 @@ endif
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
RCRAWS = etc/txtable.txt
endif # CONFIG_TXTABLE_PARTITION
endif

View file

@ -41,14 +41,6 @@ DEPPATH += --dep-path board
VPATH += :board
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
RCRAWS = etc/txtable.txt
endif # CONFIG_TXTABLE_PARTITION
endif
ifeq ($(CONFIG_IOEXPANDER_PCA9557),y)
CSRCS += esp32s3_pca9557.c
endif

View file

@ -1,24 +0,0 @@
/****************************************************************************
* boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rc.sysinit
*
* 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.
*
****************************************************************************/
#include <nuttx/config.h>