Commit graph

62961 commits

Author SHA1 Message Date
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
Filipe Cavalcanti
c92b1ed9ac boards: update LVGLTERM requirements
Adds PSEUDOTERM as selected Kconfig option on lvglterm demo defconfigs.
Required after changes on lvgl_term example app.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-08-25 12:21:08 +08:00
raiden00pl
caf0c6f0d0 tools/nxstyle: recognise typedef'd type names in declarations
The fixed list of type names holds neither uint64_t nor any NuttX
typedef, so declarations using them went unchecked.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-25 12:16:57 +08:00
raiden00pl
981d44f446 tools/nxstyle: allow a macro taking a block to span several lines
The brace was compared against the line before it rather than the line
the statement began on, so a macro broken over two lines was reported.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-25 12:16:50 +08:00
Jacob Dahl
e6696d5d27 arch/arm/src/imxrt: Keep FlexCAN TX mailbox allocation in order.
imxrt_transmit() handed out the lowest free TX mailbox. FlexCAN breaks an
arbitration tie between mailboxes holding equal CAN IDs by taking the lowest
mailbox number, so refilling a just-drained low mailbox while older frames
are still pending in higher ones puts the newer frame on the wire first.
imxrt_txdone_work() re-polls after each individual TX completion, which is
exactly the condition that triggers it.

Every frame of a multi-frame transport transfer carries the same CAN ID, so
this reorders transfers. On a DroneCAN bus the receiver sees a broken toggle
bit and discards the transfer: measured on the wire, a 6-frame message from
an i.MX RT1176 failed 82% of the time, while a node on the same bus running
a different controller was flawless over the same capture.

Hand out a mailbox above every pending one instead, and wrap back to the
bottom only once the ring has drained. Ordering then holds for any transfer
length; the cost is that the ring stalls at a wrap rather than refilling
immediately.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-25 11:34:34 +08:00
Jacob Dahl
80d432051a arch/arm/src/imxrt: Fix FlexCAN coding style violations.
Correct the switch case label indentation in imxrt_netinitialize(), the brace
alignment in imxrt_ioctl(), and the indentation of the ERR005829 workaround
statements so imxrt_flexcan.c passes nxstyle. The last of these is only
reported since commit c81cc02e83.

These predate this series; CONTRIBUTING.md section 2.1 asks that modified
files be brought into compliance even where the contributor did not introduce
the problem.

Whitespace only, no functional change: `git diff -w` against the parent is
empty.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-25 11:34:34 +08:00
zhangyu117
d26c24bc7b arch/tricore: use tricore arch-atomic-instruction version
Select LIBC_ATOMIC_ARCH for TriCore when not using Tasking toolchain,
so that the tricore arch-atomic implementation is used instead of
the toolchain builtin.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-25 10:07:25 +08:00
zhangyu117
a51ecf629a arch/tricore: drop illd dependence for atomic
Replace ILLD intrinsics (__swap, __ld32, __cmpAndSwap) with inline
assembly functions (tricore_atomic_swap, tricore_atomic_cmpswap) to
remove the dependency on IfxCpu_Intrinsics.h.

Also fix the expect parameter type to use volatile void * to match
the declaration in atomic.h, avoiding type conflicts.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-25 10:07:25 +08:00
raiden00pl
b444d9d7f2 boards/qemu-intel64: add NXTerm display console config
Add an NXTerm framebuffer configuration for QEMU and Intel64 hardware.

Enable USB keyboard input, PCI serial logging, CPython, and serial fallback.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-25 10:06:53 +08:00
raiden00pl
5a219ec775 drivers/pci/pci.c: fix nxstyle issues
Some checks are pending
Build Documentation / build-html (push) Waiting to run
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
drivers/pci/pci.c: fix nxstyle issues

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-25 01:40:32 +08:00
raiden00pl
3e7ceed289 drivers/pci: enable upstream bridge forwarding
PCI endpoints cannot perform memory transactions when a bridge in
their hierarchy has memory forwarding or bus mastering disabled.
Firmware may leave these bits clear when handing a device over
after PXE boot.

Enable both bits on every parent bridge before enabling the
endpoint.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-25 01:40:32 +08:00
raiden00pl
c81cc02e83 tools/nxstyle: check alignment of statements without a leading keyword
Only lines beginning with a C keyword were checked, so an assignment or
a call could sit at any column.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-24 19:09:03 +02:00
raiden00pl
90b71fb883 tools/nxstyle: allow CPython API identifiers
CPython exposes mixed-case PyMem_* and PyOS_* names that applications cannot rename.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-25 01:04:20 +08:00
jsanchez-2g
1eb4ec6d49 boards/nucleo-g0b1re: Add USB device configurations
Add HSI48 clock selection, USB pull-up control, automatic CDC/ACM registration during board bring-up, USB test configurations, and board documentation.

Assisted-by: OpenAI Codex
Signed-off-by: jsanchez-2g <jsanchez@2g-eng.com>
2026-08-25 01:03:58 +08:00
Marco Casaroli
fae893d411 libs/libc/elf: Give a shared object a word alignment, not zero.
Some checks failed
Build Documentation / build-html (push) Waiting to run
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
Docker-Linux / push (push) Has been cancelled
libelf_elfsize() takes textalign and dataalign from the section headers,
which only the ET_REL path walks.  An ET_DYN object is sized from its
program headers instead, so both fields stay at zero, and the allocation
a few lines later asks for that alignment:

  loadinfo->textalloc = lib_memalign(loadinfo->textalign, ...);

Zero is not a valid alignment, and every path that receives it divides by
it.  mm_memalign() accepts zero as a power of two, because 0 & -0 is 0,
then takes the "alignment <= MM_ALIGN" branch and evaluates
"((uintptr_t)ptr) % alignment" in a DEBUGASSERT.  With
CONFIG_MM_HEAP_MEMPOOL and a pool that fits the request the object never
reaches that branch and gets ALIGN_UP(blk, 0) instead, which is
((blk - 1) / 0) * 0.

On Cortex-M this is usually invisible: UDIV returns zero for a division
by zero unless CCR.DIV_0_TRP is set, which NuttX does not set, so the
assertion compares zero against zero and passes.  It is a SIGFPE on the
simulator, and the mempool path returns a null pointer wherever the
division yields zero, which the loader reports as -ENOMEM.

Ask for a natural word when the program headers gave nothing.  p_align is
the linker's page granularity, not a section requirement, so honouring it
would cost a page per module for no gain, and the sections of a shared
object need no more than a word.

Built for mps3-an547:picostest, which is CONFIG_ELF with CONFIG_PIC.
Runtime evidence on hardware follows.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-24 15:48:33 +08:00
raiden00pl
bdeb262b8d tools/nxstyle: indent code against its enclosing brace, not modulo 4
A residue modulo four expresses neither the indentation unit nor the
alignment of case logic, and all of it was disabled from the first
switch to the end of the enclosing function.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-24 09:41:55 +02:00
Alan Carvalho de Assis
1267f78dcc doc/esp32s3: Update esp32s3-touch-lcd7 documentation
This commit updates the board documentation.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
Alan Carvalho de Assis
5486ed1e9b boards/esp32s3-touch-lcd7: Add support to LCD
This patch adds support to 7" 800x480 LCD on esp32s3-touch-lcd7
board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
Alan Carvalho de Assis
8c7a5701e3 esp32s3/lcd: Fix rolling issue on high resolution LCDs
This patch get some fixes from ESP-IDF to fix a rolling issue
that happens on big resolution LCDs such as 800x480 LCDs.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
Alan Carvalho de Assis
8342c51d59 ioexpander/ch422g: add a driver for the WCH CH422G I/O
The CH422G offers eight bi-directional pins, IO0-IO7, and four open-drain
outputs, OC0-OC3.  It appears on boards that have run out of usable GPIOs
once a parallel RGB panel has taken its share, the Waveshare
ESP32-S3-Touch-LCD-7 among them, where it holds the panel and touch
controller in and out of reset and switches the backlight.

Two things about the device do not fit the shape a register-per-address
I2C driver usually takes, and both are handled here rather than pushed on
to board logic:

  - A register is selected by the I2C address the transfer is addressed
    to, not by a register address written ahead of the data.  Each access
    carries a single byte to one of four addresses.
  - None of the write-only registers can be read back, so the driver
    keeps a shadow copy of each and updates it in step with the device.

IO0-IO7 have no individual direction control; one bit of the system
parameter register drives the whole group.  The driver records the
direction asked of each pin and puts the group in output mode once at
least one of them is an output, which is what a board that drives some of
the pins would expect.  Reading a pin of a group held in output mode
reports the value last written, because the hardware cannot report the
level, and that is documented rather than hidden.

The four open-drain outputs are presented as pins 8-11 of the same
ioexpander_dev_s so that one instance covers the chip, which means
CONFIG_IOEXPANDER_NPINS must be at least 12.

Builds clean with no new warnings on esp32s3-touch-lcd7:usbnsh and passes
nxstyle.

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-08-24 09:39:58 +02:00
dechao_gong
bf1ac68987 arch/arm/rtl8721f: add ADC driver support
Wire the shared Ameba ADC driver into the RTL8721F build: add the
per-chip ameba_adc_chip.h (12 channels, CH0..CH7 external on
PA20,PA19,PA18,PA17,PA15,PA14,PA13,PA12, PINMUX function 5), the
board ADC table and registration, the adc board config, and build
glue for both cmake and make (including the fwlib RAM-layer
ameba_adc.c in ameba_board.mk). Document the ADC on the board index.

Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Assisted-by: Claude <noreply@anthropic.com>
2026-08-24 09:32:19 +02:00
dechao_gong
e5267f00a5 arch/arm/rtl8720f: add ADC driver support
Wire the shared Ameba ADC driver into the RTL8720F build: add the
per-chip ameba_adc_chip.h (9 channels, CH0..CH5 external on
PA13..PA18, PINMUX function 5, APB clock on bit24), the board ADC
table and registration, the adc board config, and build glue for
both cmake and make (including the fwlib RAM-layer ameba_adc.c in
ameba_board.mk). Document the ADC on the board index.

Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Assisted-by: Claude <noreply@anthropic.com>
2026-08-24 09:32:19 +02:00
dechao_gong
07fd8cc936 arch/arm/rtl8721dx: add shared Ameba ADC driver
Add a NuttX ADC lower-half for the Ameba SoC family, wired for the
amebadplus/pke8721daf as /dev/adc0.  The driver uses the fwlib ROM
API and drives on-demand polled conversions via ADC_ReceiveBuf with
the hardware auto channel-switch FIFO, because amebadplus disables the
ADC software-trigger path.  Per-chip wiring (channel count, pinmux
function id, APB clock bits, optional aux clock) lives in a chip
header so a new IC only supplies its own values without touching the
shared driver.

Reports raw conversion codes per the NuttX convention (12-bit
effective, 0..~3876 for 0..3.3V), consistent with the STM32/i.MXRT/
Tiva ADC drivers.

Verified on hardware: 0V->121, 3.3V->3876 on CH0(PB19) while
CH1(PB18) held steady, confirming sampling, full-scale and
multi-channel switch-list isolation.

Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Assisted-by: Claude <noreply@anthropic.com>
2026-08-24 09:32:19 +02:00
dependabot[bot]
f62ccf5b35 build(deps): bump docker/setup-buildx-action from 4.2.0 to 4.3.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](bb05f3f551...37fe631027)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-24 15:30:16 +08:00
zhangyu117
95fe3e8680 nuttx/atomic.h: use _Atomic define atomic_t.
Some checks are pending
Build Documentation / build-html (push) Waiting to run
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
1. use _atomic as wrapper because if _Atomic empty, may affects the compilation of other files:

2. for clang builtin function, it donot accept param with keyword "_Atomic"

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-08-24 13:20:45 +08:00