nuttx/boards/xtensa/esp32s3/common
wangjianyu3 8bd50d2797 boards/xtensa/esp32s3/esp32s3-xiao: re-enable nxinit, with a working console
This restores the entrypoint switch from commit
7cc6707a76 ("boards/esp32s3-xiao: switch
defconfigs to nxinit entrypoint"), reverted in 76b90e02cbe4967193
b620abcb1efb9f6b3f8f5b after a real-hardware regression report on
Seeed XIAO ESP32-S3 (board hangs, no USB console), and fixes the
actual root cause this time instead of just reverting it.

Root cause: the shared boards/xtensa/esp32s3 init.rc starts the
interactive console as a plain "sh", which, unlike nsh_main's
nsh_consolemain(), never registers/connects the CDC-ACM gadget this
board uses as its console (CONFIG_CDCACM_CONSOLE=y, no
CONFIG_DEV_CONSOLE). Restoring the previous commit's entrypoint switch
on its own is therefore not sufficient - it would just reintroduce the
same regression, so that commit is folded into this one rather than
kept as a separate, individually broken step.

Fix, using the "console" service option added to nxinit by a companion
apps change:

- init.rc: bring up the console gadget once, unconditionally, before
  any service starts, via "exec -- sercon" (apps/system/cdcacm already
  implements exactly this and depends on neither nxinit nor nsh); flag
  the "console" service with the new "console" option so its stdio is
  connected to the (now registered) gadget device.
- esp32s3-xiao's usbnsh/combo defconfigs: add CONFIG_SYSTEM_CDCACM=y so
  sercon is actually built in. Verified with "make savedefconfig"
  against both defconfigs (byte-identical, no manual edits beyond the
  generated diff).

Verified end to end on real Seeed XIAO ESP32-S3 Sense hardware
(usbnsh): after this change the board enumerates its NuttX CDC-ACM
gadget on a normal reset and boots to an interactive nsh session
spawned by nxinit ("ps" shows init_main as PID 2, parent of "sh").

Assisted-by: Kiro:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-09-11 21:12:18 +08:00
..
include xtensa/espressif: Update common-source integration for Xtensa devices 2026-03-29 00:33:11 +08:00
kernel protect: move us_heap to userspace_data_s 2026-02-02 11:06:53 +08:00
scripts xtensa/esp32s3: Let a protected build boot from simple boot. 2026-08-11 23:49:21 +08:00
src boards/xtensa/esp32s3/esp32s3-xiao: re-enable nxinit, with a working console 2026-09-11 21:12:18 +08:00
.gitignore boards/esp32[c3|c6|h2|s2|s3]: Ignore etctmp in common board 2024-07-12 01:01:15 +08:00
Kconfig boards/xtensa: fix optional item on spiflash config 2026-03-19 17:46:28 +08:00
Makefile xtensa/espressif: Update common-source integration for Xtensa devices 2026-03-29 00:33:11 +08:00