Commit graph

62985 commits

Author SHA1 Message Date
dechao_gong
2b65c77adb arch/arm/rtl8721dx: add shared Ameba RTC driver
Expose the Ameba on-chip RTC as a NuttX date/time RTC at /dev/rtc0
(rdtime/settime) with a single one-shot alarm (setalarm/rdalarm/
cancelalarm/setrelative) that fires the RTC interrupt and the upper-half
callback.  The same hardware also backs the arch date/time RTC hooks
(up_rtc_initialize/getdatetime/settime, g_rtc_enabled) so the NuttX
system time is seeded from it.

The driver sits on the SDK fwlib RTC API (mirrored structures + local
externs, no vendor headers pulled into the NuttX include world).  The
fwlib RTC API lives in the RAM source ameba_rtc.c, so it is added to the
board fwlib build under CONFIG_AMEBA_RTC.  The hardware keeps a year plus
a day-of-year (no month/day register); the driver bridges that to the
NuttX month/day calendar with the libc UTC routines (timegm/gmtime_r),
which is exact and reversible.

The only per-chip fact -- the RTC interrupt vector -- lives in the
per-chip ameba_rtc_chip.h; the shared driver is never edited for a new
Ameba chip.  A configs/rtc profile (examples/alarm) is added for
verification.

Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Assisted-by: Claude <noreply@anthropic.com>
2026-08-27 01:09:15 +08:00
raiden00pl
f1d516fa44 boards/arm/stm32c5: Add nucleo-C562re support
Add initial support for nucleo-C562re

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
84d50ebea2 Documentation: Complete STM32U3 peripheral status
List every peripheral implemented by STM32U3C5, and update the common GPIO, EXTI
and USART driver paths after the Cortex-M33 migration.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
d523171d01 arch/arm/stm32c5: Add STM32C562 architecture support
Add intiial support for STM32C562 and use common STM32 M33 sources.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
8de9306342 arch/arm/stm32: Introduce STM32_COMMON_M33 family group
Replace the enumerated STM32U3/U5 chip conditions in the common M33
source lists and the RCC dispatch header with a single STM32_COMMON_M33
symbol, following the existing STM32_COMMON_* convention.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
7d0ad175ac arch/arm/stm32: Unify Cortex-M33 RCC include names
Rename the U3 and U5 family-local Cortex-M33 RCC headers to
stm32_rcc_m33.h and dispatch to that private name for the two families
in the common RCC header.

This lets the shared M33 USART implementation use one include name
while RCC registers and clock definitions remain family-local. Extend
the stm32_ports.rst naming rules with the M33 header, source, and
Kconfig symbol conventions.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
e20c4a76b6 arch/arm/stm32: Generalize Cortex-M33 heap support
Rename the shared U3/U5 heap allocator to stm32_allocateheap_m33_v1.c
and keep its direct family selection in Make and CMake.

Size the primary region from a now-mandatory STM32_PRIMARY_SRAM_SIZE,
provided by the U5 chip header as the SRAM1 size, and drop the
U5-specific SRAM bank descriptions so the allocator carries no family
conditionals.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
b269bb0c91 arch/arm/stm32: Generalize Cortex-M33 startup
Rename the shared U3/U5 reset handler to stm32_start_m33_v1.c and keep
its direct family selection in Make and CMake.

Include stm32_userspace.h only under CONFIG_BUILD_PROTECTED and define
the SRAM2 span only when CONFIG_STM32_SRAM2_INIT requests the parity
initialization, so families without SRAM2 parity or userspace support
can use the file unchanged.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
47b7b14423 arch/arm/stm32: Generalize Cortex-M33 USART support
Rename the shared U3/U5 USART sources to stm32_serial_m33_v3.c and
stm32_lowputc_usart_m33_v3.c and gate them with a new
STM32_HAVE_IP_USART_M33_V3 symbol selected by the U3 and U5 peripheral
options. Rename the USART hardware header to stm32_uart_m33_v3.h with
its register map unchanged.

Store each port's RCC enable register and bit in the serial
descriptor, provided by the family RCC headers as
STM32_<port>_FREQUENCY, _RCC_REG and _RCC_EN, so common clock control
needs no family-specific switch. Correct the LPUART1 RX DMA map name
to DMAMAP_LPUART1_RX.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
399f76d6ed arch/arm/stm32: Generalize Cortex-M33 GPIO and EXTI support
Rename the U3/U5 GPIO and EXTI sources to stm32_gpio_m33_v1.c and
stm32_exti_gpio_m33_v1.c and gate them with new
STM32_HAVE_IP_GPIO_M33_V1 and STM32_HAVE_IP_EXTI_M33_V1 symbols
selected by the U3 and U5 peripheral options.

Rename the GPIO and EXTI hardware headers to stm32_gpio_m33_v1.h and
stm32_exti_m33_v1.h with their register maps unchanged, dispatch to
them from the common GPIO and EXTI hardware headers by the new IP
symbols, and widen STM32_EXTI_EXTICR_PORT_MASK to the full 8-bit
EXTICR port-select field.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
52cf372b21 arch/arm/stm32: Drop dead Cortex-M33 SysTick clock-source selection
Remove the disabled CONFIG_STM32_SYSTICK_HCLKd8 reload path and the
non-functional clock-source write. SysTick always runs from HCLK on
these devices, so compute the reload value from STM32_HCLK_FREQUENCY
only.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
d9eb2a7a55 arch/arm/stm32: Generalize the Cortex-M33 NVIC dump helper
Iterate the NVIC interrupt enable and priority registers from
STM32_IRQ_NEXTINTS instead of dumping a hardcoded U3/U5 register list,
so the helper works unchanged for any interrupt count.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
94b7968c89 arch/arm/stm32: Generalize Cortex-M33 core support
Rename the U3/U5 idle, NVIC, and SysTick sources to the Cortex-M33 v1
naming convention: stm32_idle_m33_v1.c, stm32_irq_m33_v1.c, and
stm32_timerisr_m33_v1.c, and move them into their own Make and CMake
block, still selected by the direct U3/U5 family condition.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:07:10 +08:00
raiden00pl
57a9860efc arch/arm: define SecureFault for STM32H5/L5/U5
define SecureFault for STM32H5/L5/U5

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:06:44 +08:00
wangjianyu3
0dccf2b289 boards/esp32p4: switch all nsh defconfigs to nxinit entrypoint
Switch all three esp32p4 boards' nsh defconfigs (esp32p4-function-ev-board,
esp32p4-pico-wifi-wareshare, esp32p4-tab5) from nsh_main to nxinit
(init_main) as the system init entry point, matching the esp32s3 boards'
existing nxinit configs for consistency across Espressif boards.

- Add boards/risc-v/esp32p4/common/src/etc/init.d/init.rc, copied from
  the esp32s3 common version: registers a "console sh" service (nsh)
  guarded by CONFIG_SYSTEM_NSH, plus adbd/fastbootd service stubs
  guarded by their own Kconfig symbols for future reuse; "on init"
  starts whichever services are enabled.
- boards/risc-v/esp32p4/common/src/Make.defs: ship init.rc via ROMFS
  (RCSRCS) when CONFIG_SYSTEM_NXINIT=y, alongside the existing
  rc.sysinit/rcS, mirroring esp32s3's Make.defs.
- Per board defconfig:
  - CONFIG_INIT_ENTRYPOINT switched to "init_main"
  - CONFIG_INIT_STACKSIZE=8192 (was unset/2048 default), matching the
    value already used and measured on esp32s3 boards for the
    nxinit init task running console-sh (and up to two services)
  - CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies:
    CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS (which depends on
    CONFIG_SCHED_HAVE_PARENT); CONFIG_EXPERIMENTAL was already set on
    all three boards
  - CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: nsh now runs as a service
    spawned by init.rc instead of being init itself, so it needs its
    own stack instead of borrowing the init stack
  - CONFIG_ETC_ROMFS/CONFIG_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/risc-v/esp32p4/common/src/etc/init.d/init.rc), not as the
top-level init.

CMake: esp32p4's common/src/CMakeLists.txt currently has no ROMFS/RCSRCS
wiring at all (unlike e.g. esp32c3's nuttx_add_romfs() block), so
rc.sysinit/rcS/init.rc are only shipped via the Make build. This is a
pre-existing gap independent of this change and is left untouched here.

Verified all three defconfigs with:
  ./tools/configure.sh -l <board>:nsh
  make -j$(nproc) CROSSDEV=riscv-none-elf-
using the xPack riscv-none-elf-gcc 14.2.0 toolchain (the local
riscv64-unknown-elf-gcc bare-metal toolchain lacks sys/cdefs.h needed
by esp-hal-3rdparty). All three link cleanly with no errors/warnings;
the built nuttx.bin contains the init.rc-embedded "service console sh"
string, confirming init.rc is picked up by the ROMFS build. Each
defconfig was regenerated with "make savedefconfig" to normalize
field ordering.

esp32p4 has no hardware attached in this session, so this change is
build-verified only; no flash/boot pass was performed.

Assisted-by: opencode/claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-27 01:05:24 +08:00
Jacob Dahl
c47ce49651 arch/arm/src/imxrt: Fix nxstyle blank lines in imxrt_flexcan.c.
Blank lines only; `git diff --ignore-blank-lines` against the parent is empty.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-27 01:04:57 +08:00
Jacob Dahl
16d501d741 arch/arm/src/imxrt: Assign FlexCAN MAXMB rather than OR-ing it in.
MAXMB resets to 0x0f, so OR-ing the intended value into MCR can only ever
raise it. Every configuration with fewer than 16 mailboxes therefore runs with
MAXMB = 15 and FlexCAN arbitrates over mailboxes the driver never initialised:
with the classic payload layout MB14 and MB15 hold power-on contents, and with
a 64-byte CAN FD layout they are past the end of the mailbox RAM region
entirely.

s32k1xx_flexcan.c already does this; carry the same two lines over.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-27 01:04:57 +08:00
Jacob Dahl
b8fdbd8543 arch/arm/src/imxrt: Store the FlexCAN TX deadline only once the frame is sent.
imxrt_transmit() wrote the caller's deadline into txmb[] before testing
whether it had already passed, and the early return for an expired deadline
then left that deadline behind on a mailbox holding no frame. The next
watchdog expiry finds it, counts a transmit timeout that did not happen, and
writes CAN_TXMB_ABORT into a mailbox the allocator may have handed to a live
frame in the meantime.

Compute the timeout first and store the deadline after the early return.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-27 01:04:57 +08:00
Jacob Dahl
58181135ab arch/arm/src/imxrt: Fix FlexCAN TX timeout aborting live mailboxes.
imxrt_txtimeout_work() had four defects that together let one expired frame
take the interface down permanently.

It aborted mailbox RXMBCOUNT + mbi while the deadline it consulted belongs to
RXMBCOUNT + 1 + mbi, so every abort landed one mailbox low and mbi == 0 wrote
CAN_TXMB_ABORT into the buffer reserved for the ERR005829 workaround, while
the highest TX mailbox was never aborted at all.

Its expiry test read `now.tv_sec > d.tv_sec || now.tv_usec > d.tv_usec`, which
declares any deadline that crosses a second boundary expired: in that case the
deadline's microsecond field is always the smaller of the two. The `now` it
compared against was a struct timespec cast to a struct timeval, so writing
tv_usec wrote over tv_nsec and tv_sec was whatever the cast happened to line
up with.

imxrt_txdone() cancelled the watchdog but left txmb[].deadline set, so a
retired mailbox looked expired forever and the next watchdog expiry on any
other mailbox aborted whatever frame had since been loaded there.

The walk ran to TXMBCOUNT, which counts the reserved mailbox as well, so its
last iteration addressed mailbox TOTALMBCOUNT - one past the ring, and
mb_address[] one past its end. Only txmb[] never being written that far kept
it in bounds. TXMBRINGSIZE now names the ring size that the rest of the driver
already assumes.

Aborting a frame that is already on the wire raises a bit error, so the
transmit error counter climbs and the node goes error passive. Since
imxrt_txmb_next() only hands out a mailbox above every pending one, a mailbox
left in DATAORREMOTE also pins the allocator at TOTALMBCOUNT and transmit
never recovers.

Measured on an ARK FMU-v6XRT with a DroneCAN GNSS node on the bus, offering
736 frames/s (9% of a 1 Mbit/s bus) from the PX4 uavcan driver: before, the
interface transmitted 0 frames/s with ECR[TXERRCNT] pinned at 128 and
ESR1[FLTCONF] error passive, and stayed dead across a reboot. After, 734
frames/s, 0.1% loss, TXERRCNT 0, error active.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-27 01:04:57 +08:00
Jorge Guzman
7cd511fed2 include/nuttx: Add link-time iterable sections infrastructure
Add generic support for link-time registration of struct instances,
modeled after the Zephyr STRUCT_SECTION_* mechanism:

- include/nuttx/iterable_sections.h: STRUCT_SECTION_ITERABLE/DECLARE/
  FOREACH/GET/COUNT macros placing instances in name-sorted linker
  sections delimited by _<type>_list_start/_end symbols (attributes
  through the nuttx/compiler.h macros; FOREACH takes a caller-declared
  iterator, like list_for_every_entry).
- include/nuttx/linker/iterable_sections.ld: ITERABLE_SECTION() macro
  emitting the KEEP + SORT_BY_NAME collection statements (linker
  scripts in ARCHSCRIPT are CPP-preprocessed).
- include/nuttx/linker/common-rom.ld / common-ram.ld: central
  aggregators meant to be included by board linker scripts (inside
  .text and .data respectively); subsystems register their sections
  here guarded by their Kconfig options, so the fragments expand to
  nothing on configurations that do not use them.
- CONFIG_ITERABLE_SECTIONS_LINKER_INSERT + include/nuttx/linker/
  common-insert.ld (added before the board script by tools/Config.mk and
  by the top-level CMakeLists.txt): optional zero-touch mode that
  supplements the board script through GNU ld INSERT AFTER, collecting
  the subsystems' ITERABLE_SECTION blocks in one output section; the
  common-rom.ld/common-ram.ld fragments expand to nothing in that mode.
  See the option help for the constraints.
- Documentation/components/iterable_sections.rst.

First user: the Zephyr zbus message bus port (apps/system/zbus in
nuttx-apps); its board integration comes in a companion PR.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-27 01:04:05 +08:00
raiden00pl
71610ddac0 drivers/serial: correct the USART9 console label
correct the USART9 console label

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-27 01:01:51 +08:00
Ruchirtripathi
6a543b8fb3 arch/risc-v: initialize qemu-rv mmu pagetable data to zero
Fixes #19874

Signed-off-by: Ruchirtripathi <tripathiruchir05@gmail.com>
2026-08-27 00:42:52 +08:00
wangjianyu3
5f29325a44 Documentation/nxinit: document boot reason property and compound cmds
Reviewers on apps#3751 (support compound command and resetcause-based
triggers) asked for documentation of the new features. Add two
sections to the nxinit doc:

- "Built-in Properties": describes the sys.boot.reason property set
  by NXInit at startup from BOARDIOC_RESET_CAUSE, its two value forms
  (hardware cause with numeric subreason, or software reset reason
  string), and behavior when CONFIG_BOARDCTL_RESET_CAUSE is disabled
  or the boardctl() call fails.
- "Compound Commands": describes the && / || short-circuit semantics
  for chaining commands on a single action line, including quoting
  behavior.

Assisted-by: GitHubCopilot:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-26 10:00:21 -03:00
raiden00pl
1f8c4bcaaf arch/intel64: fix nxstyle issues
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
fix nxstyle issues

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-26 12:17:21 +02:00
raiden00pl
3be03008ac arch/x86_64: drop unused gap below the intel64 idle stacks
The idle stack area started at _ebss + CONFIG_IDLETHREAD_STACKSIZE *
CONFIG_SMP_NCPUS, so the first CONFIG_SMP_NCPUS stack slots after .bss
were never used - 16MiB on a 4-CPU configuration with a 4MiB idle
stack.  Start the area at _ebss and let the heap begin that much
earlier.

The -16 offset is kept: it is what places the AP initial RSP set up in
intel64_head.S below the xcp->regs block that up_cpu_idlestack()
reserves at the top of the same stack.  Without it both land on the
same 64-byte slot and the first context save corrupts the AP stack.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-26 12:17:21 +02:00
raiden00pl
1a0586826e arch/x86_64: generalize intel64 idle stacks
intel64 port explicitly enumerates five idle-stack
addresses and rejects configurations with more than five CPUs.

Store the CPU0 stack top and calculate every CPU stack address
from its index.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-26 12:17:21 +02:00
raiden00pl
538aa8cbbc arch/x86_64: fix AP initial stack alignment
The AP boot path masked RSP with ~XCPTCONTEXT_SIZE, which just clears
whichever bits happen to be set in the size (0x340 -> mask 0xfffffcbf).
That drops RSP by an arbitrary amount and only guarantees 16-byte
alignment, while the XSAVE area in the context needs 64.

Mask with ~(XCPTCONTEXT_ALIGN - 1) instead.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-26 12:17:21 +02:00
Filipe Cavalcanti
d8104193b8 boards: fix lvglterm defconfig
Refresh the defconfigs that use lvglterm after some changes on app.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-08-26 17:25:34 +08:00
Eren Terzioglu
fe89572632 arch/risc-v: Add nonblock timeout support for LP-Mailbox
Add nonblock timeout support for LP-Mailbox for esp32[-c6|-p4]

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-08-26 10:31:27 +08:00
wangjianyu3
87db6b21f8 boards/esp32s3-8048S043: switch defconfigs to nxinit entrypoint
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
7cc6707a76 boards/esp32s3-xiao: switch defconfigs to nxinit entrypoint
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 73c949c87e)
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>
2026-08-25 11:03:32 -03:00
wangjianyu3
f4181d2a60 boards/esp32s3-ws-lcd128: switch defconfigs to nxinit entrypoint
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
d4620687ad boards/esp32s3-touch-lcd7: switch defconfigs to nxinit entrypoint
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 73c949c87e)
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>
2026-08-25 11:03:32 -03:00
wangjianyu3
f7b9565bee boards/esp32s3-meadow: switch defconfigs to nxinit entrypoint
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 73c949c87e)
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>
2026-08-25 11:03:32 -03:00
wangjianyu3
b842fd696a boards/esp32s3-m5-cardputer: switch defconfigs to nxinit entrypoint
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
c6ff45ef6f boards/esp32s3-lhcbit: switch defconfigs to nxinit entrypoint
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 73c949c87e)
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>
2026-08-25 11:03:32 -03:00
wangjianyu3
ad97a98b87 boards/esp32s3-lcd-ev: switch defconfigs to nxinit entrypoint
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
a0bda84039 boards/esp32s3-korvo-2: switch defconfigs to nxinit entrypoint
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
73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
fe289dccb1 boards/esp32s3-eye: switch defconfigs to nxinit entrypoint
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
73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
1feb93a5ae boards/esp32s3-devkit: switch defconfigs to nxinit entrypoint
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
50a0f3b82a boards/esp32s3-box: switch defconfigs to nxinit entrypoint
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 73c949c87e) 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>
2026-08-25 11:03:32 -03:00
wangjianyu3
021a113203 boards/lckfb-szpi-esp32s3: switch all defconfigs to nxinit entrypoint
Switch all lckfb-szpi-esp32s3 defconfigs from nsh_main to nxinit
(init_main) as the system init entry point, for consistency across
the whole board (adb and txtable already used nxinit, see
73c949c87e).

For each defconfig (adb, camera, es7210, fastboot, fastboot_tcp,
gc0308, gpio, lcd, lvgl, nsh, pca9557, psram, pwm, qmi8658, sdmmc,
usb_device, uvc, vncviewer):

- CONFIG_INIT_ENTRYPOINT="nsh_main" -> "init_main"
- CONFIG_INIT_STACKSIZE raised to 8192. The default init and nsh
  stacks overflow at runtime on this target: init_main overflows a
  smaller stack (observed 100% usage with a corrupted task name),
  clobbering the global inode/mount tree so the procfs mount
  installed by board bringup disappears; "ls /" then crashes in
  read_pseudodir and "ps" reports "/proc not mounted". Raising
  CONFIG_INIT_STACKSIZE to 8192 drops init_main to about 61% usage
  on hardware, and /proc stays mounted.
- CONFIG_SYSTEM_NXINIT=y added, plus its direct Kconfig dependencies
  (CONFIG_EXPERIMENTAL, CONFIG_LIBC_EXECFUNCS, CONFIG_SCHED_CHILD_STATUS
  which in turn selects CONFIG_SCHED_HAVE_PARENT)
- CONFIG_SYSTEM_NSH_STACKSIZE=8192 added: the nsh console service
  launched by init.rc also needs a larger stack, otherwise it
  crashes in getumask while running "ps" because its stack is 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, matching the adb/txtable configs.

Verified all 20 defconfigs (adb, camera, es7210, fastboot,
fastboot_tcp, fastboot_usb, gc0308, gpio, lcd, lvgl, nsh, pca9557,
psram, pwm, qmi8658, sdmmc, txtable, usb_device, uvc, vncviewer) build
cleanly with `make`. Flashed nsh and es7210 to hardware:
- nsh: UART0 console reachable, "ps" shows init_main (PID 2) as the
  parent of nsh's "sh" (PID 3).
- es7210: adb reachable, "ps" shows init_main (PID 4) as the parent of
  both "sh" (PID 5) and "adbd" (PID 6).

Assisted-by: Kiro:claude-sonnet-5
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-25 11:03:11 -03:00
Alin Jerpelea
29bfa8eeb6 AUTHORS: add Jorge Guzman
Jorge Guzman has submitted the ICLA and should be added to
the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-08-25 08:43:13 -04:00
raiden00pl
15b55a22fa tools/nxstyle: require a blank line after a function's declarations
The standard asks for a blank line between the local declarations at the
head of a function and the code.  A declaration is recognised by its
shape, since no list of type names can be complete.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-25 19:20:08 +08:00
raiden00pl
828a786995 tools/nxstyle: let an alternative branch hold statements before its braces
Alternatives selected by conditional compilation share the braces that
follow, and a branch may hold statements before reaching its condition.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-25 19:19:29 +08:00
Jacob Dahl
b986fb8ee5 {arm,xtensa}/otg: indent switch bodies per the coding standard.
nxstyle now checks case labels against their enclosing brace, and the
DWC2-derived OTG device drivers align every case label with the switch
brace itself, so any change that touches one of these files fails
checkpatch on hundreds of pre-existing lines.

Indent the switch bodies by two columns as the standard requires and
re-wrap the lines that this pushes past the width limit. Whitespace and
comment re-flow only; no code changes.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-25 16:07:35 +08:00
Jacob Dahl
ce0038f2bc {arm,xtensa}/otg: unmask WKUP so USB resume reaches the class driver.
Every DWC2-derived USB device driver enables USBSUSP in GINTMSK but not
WKUP, and every one of them ANDs GINTSTS with GINTMSK before dispatch.
The resume handler is therefore unreachable: CLASS_SUSPEND is delivered
on suspend, CLASS_RESUME never is.

For CDC/ACM that is fatal. cdcacm_suspend() calls uart_connected(false),
after which serial.c refuses every open() and write() with -ENOTCONN,
and the cdcacm_resume() that would clear it never runs. On a Linux host
with the default USB autosuspend (power/control=auto, 2000 ms) simply
closing the tty is enough to trip it, and the port stays dead for the
rest of the boot while the device remains enumerated.

Verified on STM32H7 (ARK FMU v6X): before, one host suspend leaves the
CDC/ACM port permanently -ENOTCONN; after, ten forced suspend/resume
cycles all recover with the MAVLink stream intact. The remaining
drivers carry a line-for-line copy of the same initialisation.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-25 16:07:35 +08:00
Liam Howatt
21a99f9a23 boards/stm32h5/nucleo-h563zi: CMake add missing SPI SRC.
Some checks failed
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Build Documentation / build-html (push) Has been cancelled
SPI support was added to nucleo-h563zi without the CMakeLists.txt
SRCS list being updated to build stm32_spi.c. Add it.

Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
2026-08-25 13:37:44 +08:00
Liam Howatt
37ae97c077 Documentation/stm32h5: LPTIM is supported.
Change to 'Yes' in the platform peripheral list and
give the file path in the porting guide/status.

Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
2026-08-25 13:37:44 +08:00
Liam Howatt
10d0fa4485 arch/arm/stm32h5: Add LPTIM support.
Add LPTIM 1, 3, 4, 5 support. Based on STM32H7. setperiod and
setcompare have been made to wait for the auto-reload value to
be applied before returning.

6 is absent since generic stm32 configs for a 6th LPTIM are not
present yet. 2 is absent for no good reason besides maybe
that it's in a different RCC APB register. I am not adding
support last-minute without more testing. The build fails
noisily when LPTIM2 is enabled so the shortcoming is clear.

Corrected some RCC definitions. They are needed for selecting the LPTIMx
clock source. This is not done in the LPTIM driver. It is done
outside and the definitions should ideally be correct for that.

Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
Co-authored-by: Farzan Farhangian <farzanfarhangian@geotab.com>
2026-08-25 13:37:44 +08:00