boards/esp32s3: switch remaining boards' defconfigs to nxinit entrypoint - #19954
Merged
acassis merged 12 commits intoAug 25, 2026
Conversation
JianyuWang0623
force-pushed
the
esp32s3-nsh-to-init-allboards
branch
from
August 25, 2026 02:55
f51a14a to
2654254
Compare
simbit18
requested review from
eren-terzioglu,
fdcavalcanti,
tmedicci and
xiaoxiang781216
and removed request for
eren-terzioglu
August 25, 2026 03:57
Switch all esp32s3-box defconfigs (buttons, lvgl, lvgl-3, nsh, touchscreen) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 5 defconfigs (buttons, lvgl, lvgl-3, nsh, touchscreen) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-devkit defconfigs still on nsh_main (adc, audio, ble, blewifi, buttons, capture, crypto, cxx, efuse, elf, eth_lan9250, fastboot, fastboot_tcp, gpio, i2c, i2schar, knsh, ksta_softap, mbedtls, mcuboot_nsh, mcuboot_update_agent, motor, nsh, nxlooper, oneshot, ostest, pm, psram_octal, psram_quad, psram_usrheap, pwm, python, qemu_debug, qemu_openeth, qemu_toywasm, qencoder, random, rmt, romfs, rtc, sdm, sdmmc, sdmmc_spi, smp, sotest, spi, spiflash, spislv, sta_softap, stack, temperature_sensor, tickless, timer, toywasm, twai, ulp, usb_device, usbnsh, watchdog, wifi) to nxinit (init_main) as the system init entry point, matching this board's adb/txtable configs that already use nxinit, and matching the lckfb-szpi-esp32s3 board (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. esp32s3-devkit:stack was the only defconfig that already set this option (at 4096); it is raised to 8192 with the rest. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init, matching this board's existing adb/txtable configs. Verified 59 of the 60 changed defconfigs build cleanly with make. esp32s3-devkit:qemu_openeth fails to link on this host both before and after this change (MERGEBIN error: missing ESPTOOL_BINDIR, a pre-existing local build-invocation issue unrelated to this patch). esp32s3-devkit:stack segfaults the linker on this host both before and after this change (pre-existing toolchain issue on this host, unrelated to this patch). esp32s3-devkit:ulp fails at context/rule generation on this host due to a missing local RISC-V ULP toolchain setup, also unrelated to this patch. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-eye defconfigs (gpio, i2c, lcd, nsh, usbnsh, wifi) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 6 defconfigs (gpio, i2c, lcd, nsh, usbnsh, wifi) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-korvo-2 defconfigs (audio, nsh, rtptools, sdmmc) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 4 defconfigs (audio, nsh, rtptools, sdmmc) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-lcd-ev defconfigs (audio, buttons, lcd, lvgl, nsh, ws2812) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 6 defconfigs (audio, buttons, lcd, lvgl, nsh, ws2812) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch the esp32s3-lhcbit usbnsh defconfig from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified the usbnsh defconfig builds cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfig is the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-m5-cardputer defconfigs (fb, lvgl, lvglterm, nsh, sdcard, softap, wifi) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 7 defconfigs (fb, lvgl, lvglterm, nsh, sdcard, softap, wifi) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-meadow defconfigs (nsh, usbnsh) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified both defconfigs (nsh, usbnsh) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch both esp32s3-touch-lcd7 defconfigs (lcd, usbnsh) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified both defconfigs build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-ws-lcd128 defconfigs still on nsh_main (imu-qmi8658, nsh, ostest, watchdog) to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. This board's coremark, notouch-lvgl and touch-lvgl defconfigs use other custom entrypoints and are unaffected. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 4 defconfigs (imu-qmi8658, nsh, ostest, watchdog) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-xiao defconfigs (combo, usbnsh) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified both defconfigs (combo, usbnsh) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Switch all esp32s3-8048S043 defconfigs (gpio, i2c, lcd, nsh, sdmmc, spi, touchscreen) from nsh_main to nxinit (init_main) as the system init entry point, matching the lckfb-szpi-esp32s3 board's existing nxinit configs (see 73c949c) for consistency across esp32s3 boards. For each defconfig: - CONFIG_INIT_ENTRYPOINT switched to "init_main" - CONFIG_INIT_STACKSIZE set to 8192. Measured on lckfb-szpi-esp32s3 with CONFIG_STACK_COLORATION=y on the worst case available: a config whose init.rc starts two services (console sh + adbd). At the 2048 Kconfig default the board panics at runtime (xtensa_user_panic, task "sh"); at 4096 init_main reaches FILLED=99.5%, i.e. no headroom; at 8192 it settles at USED=4336 (53.6%). A single-service config only fills 46.9% of a 3072-byte init stack, so 8192 is deliberately uniform rather than minimal: it covers the two-service worst case with roughly 2x margin and keeps every defconfig off the 2048 default, where the init stack overflows and clobbers the global inode/mount tree - the procfs mount disappears, "ls /" crashes in read_pseudodir and "ps" reports "/proc not mounted". - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS, which depends on CONFIG_SCHED_HAVE_PARENT) - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service spawned by init.rc instead of being init itself, so the shell workload is carried by its own stack rather than the init stack. Without this it falls back to CONFIG_DEFAULT_TASK_STACKSIZE (2048 unless the defconfig overrides it) and crashes in getumask while running "ps", too small to reach the procfs read path. - ETC_ROMFS/FS_ROMFS added where missing, needed to ship init.rc via the board's ROMFS nsh continues to run as a console service started by init.rc (boards/xtensa/esp32s3/common/src/etc/init.d/init.rc), not as the top-level init. Verified all 7 defconfigs (gpio, i2c, lcd, nsh, sdmmc, spi, touchscreen) build cleanly with make. Runtime behavior (init_main spawning nsh as a console service) was confirmed on lckfb-szpi-esp32s3 hardware, which shares the same nxinit/init.rc mechanism; this board has no hardware attached for a flash/boot pass in this session, so the build-verified defconfigs are the extent of local testing here. Assisted-by: Kiro:claude-sonnet-5 Assisted-by: Kiro:claude-opus-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
JianyuWang0623
force-pushed
the
esp32s3-nsh-to-init-allboards
branch
from
August 25, 2026 09:07
2654254 to
ff92018
Compare
jerpelea
approved these changes
Aug 25, 2026
JianyuWang0623
force-pushed
the
esp32s3-nsh-to-init-allboards
branch
2 times, most recently
from
August 25, 2026 10:49
d4adb3d to
d06cc19
Compare
acassis
approved these changes
Aug 25, 2026
Contributor
|
@JianyuWang0623 please normalize: boards/xtensa/esp32s3/esp32s3-m5-cardputer/configs/lvglterm/defconfig |
acassis
marked this pull request as ready for review
August 25, 2026 14:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
lckfb-szpi-esp32s3board's defconfigs already runnxinit(init_main)as system init instead of
nsh_main(see #19946, still open at the time ofthis PR). This extends the same switch to the remaining 12 boards under
boards/xtensa/esp32s3that still usednsh_main(esp32s3-8048S043,esp32s3-box, esp32s3-devkit, esp32s3-eye, esp32s3-korvo-2, esp32s3-lcd-ev,
esp32s3-lhcbit, esp32s3-m5-cardputer, esp32s3-meadow, esp32s3-touch-lcd7,
esp32s3-ws-lcd128, esp32s3-xiao), for consistency across all esp32s3 boards.
106 defconfigs changed, one commit per board.
For each defconfig:
CONFIG_INIT_ENTRYPOINTswitched from"nsh_main"to"init_main"CONFIG_INIT_STACKSIZEset to 8192, andCONFIG_SYSTEM_NSH_STACKSIZEset to 8192 for the nsh console service launched by init.rc. See the
Testing section below for the measured stack usage behind this value —
it is not a guessed number.
CONFIG_SYSTEM_NXINIT=yadded, plus its direct Kconfig dependencies(
CONFIG_EXPERIMENTAL,CONFIG_LIBC_EXECFUNCS,CONFIG_SCHED_CHILD_STATUS,which depends on
CONFIG_SCHED_HAVE_PARENT)CONFIG_ETC_ROMFS/CONFIG_FS_ROMFSadded where missing, needed to shipinit.rcvia the board's ROMFSnshkeeps running, just as a console service started by init.rc(
boards/xtensa/esp32s3/common/src/etc/init.d/init.rc) instead of thetop-level init.
Policy question worth raising explicitly
CONFIG_SYSTEM_NXINIT(apps/system/nxinit/Kconfig) still depends onCONFIG_EXPERIMENTAL. This PR turns onCONFIG_EXPERIMENTAL=yfor theesp32s3 boards' existing defconfigs in place, rather than adding new
*-nxinit-style variant configs alongside the existing ones. The only otherupstream precedent for
CONFIG_SYSTEM_NXINITtoday(
boards/arm64/bcm2711/raspberrypi-4b/configs/nxinit) took theadd-a-variant-config approach instead of converting an existing board's
configs in place. Flagging this up front rather than waiting for it to come
up in review — happy to switch to variant configs if that is the preferred
pattern for a still-
EXPERIMENTALcomponent.Impact
Affects only defconfigs under
boards/xtensa/esp32s3(12 boards, 106defconfigs). No change to shared arch/board source, no ABI/API changes.
Stack and image footprint change on these boards only:
CONFIG_INIT_STACKSIZEbecomes 8192 everywhere. Across these 106defconfigs it was previously 3072 (79 configs), 4096 (12), already 8192
(12), and absent (3) — absent meaning the 2048 Kconfig default.
CONFIG_SYSTEM_NSH_STACKSIZE=8192is a new line in 105 of the 106; onlyesp32s3-devkit:stackset it before, at 4096. Previously the shellinherited
CONFIG_DEFAULT_TASK_STACKSIZE, which is 2048 in 94 of thesedefconfigs and 4096 in the other 12.
CONFIG_ETC_ROMFS(esp32s3-devkit'sfastboot,fastboot_tcpandromfsalready had it), which adds theshared
init.rcto the board's ROMFS image.CONFIG_EXPERIMENTAL(esp32s3-devkit:pythonand
esp32s3-devkit:sotestalready had it) — see the policy note above.Testing
Build Host: Linux x86_64, xtensa-esp32s3-elf-gcc 12.2.0 (ESP-IDF toolchain)
Target: esp32s3 (12 boards, 106 defconfigs)
103 of 106 changed defconfigs build cleanly with
makeon this host. CIcovers 104 of the 106:
tools/ci/testlist/xtensa-03.datis the whole/xtensa/esp32s3tree minusesp32s3-devkit:pythonandesp32s3-devkit:qemu_openeth, and theLinux (xtensa-03)job additionallyruns the
tools/refresh.shdefconfig normalization check on each config itbuilds. That job passed on an earlier revision of this branch; for the current
revision please read the CI status on this PR rather than this paragraph. The
3 local failures below are host-environment issues, not regressions:
esp32s3-devkit:qemu_openeth— link step fails withMERGEBIN error: Missing argument for binary files directory(missingESPTOOL_BINDIR),a local build-invocation issue; excluded from CI's xtensa-03 list anyway.
esp32s3-devkit:stack— linker segfaults (make[1]: *** [Makefile:183: nuttx] Segmentation fault), a local toolchain issue on this host,reproduced identically on unmodified code before this patch.
esp32s3-devkit:ulp—contextstep fails (check_rv_toolchain) due toa missing local RISC-V ULP cross-toolchain.
tools/checkpatch.sh -g apache/master..HEADpasses on the full diff.tools/refresh.sh --silentwas also run locally on the defconfigs touchedlast (
esp32s3-touch-lcd7:lcd,esp32s3-devkit:stack,esp32s3-box:buttons,esp32s3-eye:gpio,esp32s3-lcd-ev:buttons) plusesp32s3-devkit:nshandesp32s3-box:nshas controls: nosavedefconfigdiff on any of the 7.Stack sizing: measured, not guessed
No hardware was attached for any of these 12 boards in this session.
Runtime behavior of the nxinit/init.rc mechanism was instead verified on
lckfb-szpi-esp32s3 hardware (which already uses the identical mechanism),
since
init_maintaking over as system init and starting nsh as a consoleservice is a chip/OS-level behavior, not board-specific.
CONFIG_STACK_COLORATIONwas enabled on lckfb-szpi-esp32s3 to measure realstack high-water marks (
ps'sUSED/FILLEDcolumns) rather than pick8192 by trial and error. The worst-case scenario is a defconfig where
init.rc starts more than one service concurrently — the
adbdefconfig(
console sh+adbd) was used for this:For a single-service defconfig (plain
nsh, only the console service),init_mainat the pre-conversion default of 3072 does not actuallyoverflow — measured FILLED was 46.9% (about 1.4KB used). The failure mode
that motivates raising
INIT_STACKSIZEuniformly is specifically themulti-service case (adb, fastboot, etc.), not every defconfig on this
family. 8192 is taken as the uniform value across all 106 defconfigs because:
(1) it comfortably covers the worst measured case with ~2x margin, and
(2) keeping it board/config-specific is exactly the kind of per-defconfig
detail that is easy to miss — this PR's own review caught 3 defconfigs where
the conversion script failed to add
INIT_STACKSIZEat all, silentlyfalling back to the 2048 default and reintroducing the crash. A uniform
value removes that failure mode structurally.
Two of the converted defconfigs,
esp32s3-devkit:knshandesp32s3-devkit:ksta_softap, areCONFIG_BUILD_PROTECTED=ybuilds, wherenxinit runs in user space and starts its services through
posix_spawn.Those two are build-verified only — the protected-build path has had no
runtime verification here.
psoutput forinit_main/shon thenshdefconfig, before/after theentrypoint switch (STACK_COLORATION disabled here, so no USED/FILLED
columns — this pair is about
init_maintaking over as the boot sequenceowner, not stack margin):
Before (nsh_main as top-level init)
After (init_main as top-level init, nsh as a console service it spawns)
init_main(PID 2) is the parent of the nsh console servicesh(PID 3),confirming nxinit is in control of the boot sequence. Additional checks after
the switch:
/procstays mounted (ls /succeeds, no crash inread_pseudodir), andfree/unamerespond normally. The73ad366f45c-dirtybuild stamp above isthe raw
uname -aoutput from the test build: that commit was the head of thelckfb branch in #19946 at the time, and it has since been rebased away, so the
SHA no longer resolves. It is left as logged rather than rewritten.