Skip to content

Commit eb00c13

Browse files
fdcavalcantiacassis
authored andcommitted
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>
1 parent a729534 commit eb00c13

17 files changed

Lines changed: 212 additions & 71 deletions

File tree

boards/xtensa/esp32/common/src/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ ifeq ($(CONFIG_MMCSD_SPI),y)
174174
CSRCS += esp32_board_sdmmc.c
175175
endif
176176

177+
ifeq ($(CONFIG_ETC_ROMFS),y)
178+
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
179+
endif
180+
177181
DEPPATH += --dep-path src
178182
VPATH += :src
179183
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

boards/xtensa/esp32s3/esp32s3-8048S043/src/etc/init.d/rcS renamed to boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rcS
2+
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,10 +22,6 @@
2222

2323
#include <nuttx/config.h>
2424

25-
#ifdef CONFIG_SYSTEM_ADBD
26-
adbd &
27-
#endif
25+
/* This script "rc.sysinit" is executed after the board bring up. */
2826

29-
#ifdef CONFIG_SYSTEM_FASTBOOTD
30-
fastbootd &
31-
#endif
27+
echo "rc.sysinit is called!"

boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rc.sysinit renamed to boards/xtensa/esp32/common/src/etc/init.d/rcS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rc.sysinit
2+
* boards/xtensa/esp32/common/src/etc/init.d/rcS
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,3 +22,8 @@
2222

2323
#include <nuttx/config.h>
2424

25+
/* This script "rcS" is executed after the rc.sysinit script.
26+
* It should startup some application and other system service.
27+
*/
28+
29+
echo "rcS file is called!"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_ARCH_LEDS is not set
9+
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
11+
CONFIG_ARCH="xtensa"
12+
CONFIG_ARCH_BOARD="esp32-devkitc"
13+
CONFIG_ARCH_BOARD_COMMON=y
14+
CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
15+
CONFIG_ARCH_CHIP="esp32"
16+
CONFIG_ARCH_CHIP_ESP32=y
17+
CONFIG_ARCH_CHIP_ESP32WROVER=y
18+
CONFIG_ARCH_STACKDUMP=y
19+
CONFIG_ARCH_XTENSA=y
20+
CONFIG_BOARD_LOOPSPERMSEC=16717
21+
CONFIG_BUILTIN=y
22+
CONFIG_ESP32_UART0=y
23+
CONFIG_ETC_ROMFS=y
24+
CONFIG_FS_PROCFS=y
25+
CONFIG_FS_ROMFS=y
26+
CONFIG_HAVE_CXX=y
27+
CONFIG_HAVE_CXXINITIALIZE=y
28+
CONFIG_IDLETHREAD_STACKSIZE=3072
29+
CONFIG_INIT_ENTRYPOINT="nsh_main"
30+
CONFIG_INIT_STACKSIZE=3072
31+
CONFIG_INTELHEX_BINARY=y
32+
CONFIG_LINE_MAX=64
33+
CONFIG_MM_REGIONS=3
34+
CONFIG_NSH_ARCHINIT=y
35+
CONFIG_NSH_BUILTIN_APPS=y
36+
CONFIG_NSH_FILEIOSIZE=512
37+
CONFIG_NSH_READLINE=y
38+
CONFIG_PREALLOC_TIMERS=4
39+
CONFIG_RAM_SIZE=114688
40+
CONFIG_RAM_START=0x20000000
41+
CONFIG_RR_INTERVAL=200
42+
CONFIG_SCHED_WAITPID=y
43+
CONFIG_START_DAY=6
44+
CONFIG_START_MONTH=12
45+
CONFIG_START_YEAR=2011
46+
CONFIG_SYSLOG_BUFFER=y
47+
CONFIG_SYSTEM_NSH=y
48+
CONFIG_UART0_SERIAL_CONSOLE=y

boards/xtensa/esp32s2/common/src/Make.defs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ ifeq ($(CONFIG_ESP32S2_TWAI)$(CONFIG_ARCH_BUTTONS),y)
9999
CFLAGS += ${INCDIR_PREFIX}$(CHIPHALDIR)$(DELIM)components$(DELIM)soc$(DELIM)$(CHIP_SERIES)$(DELIM)include
100100
endif
101101

102+
ifeq ($(CONFIG_ETC_ROMFS),y)
103+
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
104+
endif
105+
102106
DEPPATH += --dep-path src
103107
VPATH += :src
104108
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rcS renamed to boards/xtensa/esp32s2/common/src/etc/init.d/rc.sysinit

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rcS
2+
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,10 +22,6 @@
2222

2323
#include <nuttx/config.h>
2424

25-
#ifdef CONFIG_SYSTEM_ADBD
26-
adbd &
27-
#endif
25+
/* This script "rc.sysinit" is executed after the board bring up. */
2826

29-
#ifdef CONFIG_SYSTEM_FASTBOOTD
30-
fastbootd &
31-
#endif
27+
echo "rc.sysinit is called!"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/****************************************************************************
2+
* boards/xtensa/esp32/common/src/etc/init.d/rcS
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
#include <nuttx/config.h>
24+
25+
/* This script "rcS" is executed after the rc.sysinit script.
26+
* It should startup some application and other system service.
27+
*/
28+
29+
echo "rcS file is called!"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# This file is autogenerated: PLEASE DO NOT EDIT IT.
3+
#
4+
# You can use "make menuconfig" to make any modifications to the installed .config file.
5+
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
6+
# modifications.
7+
#
8+
# CONFIG_ARCH_LEDS is not set
9+
# CONFIG_NSH_ARGCAT is not set
10+
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
11+
CONFIG_ARCH="xtensa"
12+
CONFIG_ARCH_BOARD="esp32s2-saola-1"
13+
CONFIG_ARCH_BOARD_COMMON=y
14+
CONFIG_ARCH_BOARD_ESP32S2_SAOLA_1=y
15+
CONFIG_ARCH_CHIP="esp32s2"
16+
CONFIG_ARCH_CHIP_ESP32S2=y
17+
CONFIG_ARCH_CHIP_ESP32S2WROVER=y
18+
CONFIG_ARCH_STACKDUMP=y
19+
CONFIG_ARCH_XTENSA=y
20+
CONFIG_BOARD_LOOPSPERMSEC=16717
21+
CONFIG_BUILTIN=y
22+
CONFIG_ESP32S2_UART0=y
23+
CONFIG_ETC_ROMFS=y
24+
CONFIG_FS_PROCFS=y
25+
CONFIG_FS_ROMFS=y
26+
CONFIG_HAVE_CXX=y
27+
CONFIG_HAVE_CXXINITIALIZE=y
28+
CONFIG_IDLETHREAD_STACKSIZE=3072
29+
CONFIG_INIT_ENTRYPOINT="nsh_main"
30+
CONFIG_INIT_STACKSIZE=3072
31+
CONFIG_INTELHEX_BINARY=y
32+
CONFIG_LINE_MAX=64
33+
CONFIG_NSH_ARCHINIT=y
34+
CONFIG_NSH_BUILTIN_APPS=y
35+
CONFIG_NSH_FILEIOSIZE=512
36+
CONFIG_NSH_READLINE=y
37+
CONFIG_PREALLOC_TIMERS=4
38+
CONFIG_RAM_SIZE=114688
39+
CONFIG_RAM_START=0x20000000
40+
CONFIG_RR_INTERVAL=200
41+
CONFIG_SCHED_WAITPID=y
42+
CONFIG_START_DAY=6
43+
CONFIG_START_MONTH=12
44+
CONFIG_START_YEAR=2011
45+
CONFIG_SYSLOG_BUFFER=y
46+
CONFIG_SYSTEM_NSH=y
47+
CONFIG_UART0_SERIAL_CONSOLE=y

boards/xtensa/esp32s3/common/src/Make.defs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ ifeq ($(CONFIG_ESPRESSIF_LEDC),y)
106106
CSRCS += esp32s3_board_ledc.c
107107
endif
108108

109+
ifeq ($(CONFIG_ETC_ROMFS),y)
110+
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
111+
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
112+
RCRAWS = etc/txtable.txt
113+
endif
114+
endif
115+
109116
DEPPATH += --dep-path src
110117
VPATH += :src
111118
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src

boards/xtensa/esp32s3/esp32s3-8048S043/src/etc/init.d/rc.sysinit renamed to boards/xtensa/esp32s3/common/src/etc/init.d/rc.sysinit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************
2-
* boards/xtensa/esp32s3/esp32s3-devkit/src/etc/init.d/rc.sysinit
2+
* boards/xtensa/esp32/common/src/etc/init.d/rc.sysinit
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,3 +22,6 @@
2222

2323
#include <nuttx/config.h>
2424

25+
/* This script "rc.sysinit" is executed after the board bring up. */
26+
27+
echo "rc.sysinit is called!"

0 commit comments

Comments
 (0)