JianyuWang0623 opened a new pull request, #20151:
URL: https://github.com/apache/nuttx/pull/20151
## Summary
Switch `CONFIG_INIT_ENTRYPOINT` from `nsh_main` to nxinit's `init_main` for
the shell-capable configs of both `waveshare-rp2040-zero` and
`waveshare-rp2040-lcd-1.28`: `nsh` (UART console) and `usbnsh` (USB CDC/ACM
console). `nsh` now runs as a "console sh" service started by `init.rc`
instead of being the top-level init task, matching the pattern already used
on rv-virt/esp32s3/qemu.
- `boards/arm/rp2040/common/src/Make.defs`: add `init.rc` to `RCSRCS`,
gated on `CONFIG_ETC_ROMFS && CONFIG_SYSTEM_NXINIT`, following the same
pattern `boards/risc-v/qemu-rv/rv-virt` uses. Both waveshare boards share
`CONFIG_ARCH_BOARD_COMMON`'s `common/src`, so one copy of `init.rc`
covers both boards.
- `boards/arm/rp2040/common/src/etc/init.d/init.rc`: new. Starts an nsh
"console" service (`restart_period 1000`) on the "init" event. `sh`
resolves directly through the existing builtin binfmt loader
(`apps/system/nsh`'s `PROGNAME` already registers both `nsh` and `sh`),
so no `CONFIG_LIBC_ENVPATH`/`CONFIG_FS_BINFS` changes are needed here
(these boards don't set `CONFIG_LIBC_ENVPATH`).
- 4 defconfigs (`waveshare-rp2040-zero` and `waveshare-rp2040-lcd-1.28`,
each `nsh` + `usbnsh`): `CONFIG_INIT_ENTRYPOINT="init_main"`,
`CONFIG_SYSTEM_NXINIT=y` plus its previously-unset Kconfig deps
(`CONFIG_EXPERIMENTAL`, `CONFIG_LIBC_EXECFUNCS`,
`CONFIG_SCHED_HAVE_PARENT`,
`CONFIG_SCHED_CHILD_STATUS`), and `CONFIG_ETC_ROMFS=y` /
`CONFIG_FS_ROMFS=y` to ship `init.rc` via the standard `/etc` ROMFS
auto-mount (`sched/init/nx_bringup.c`'s `nx_romfsetc()`). Each defconfig
regenerated with `kconfig-tweak` + `make savedefconfig`; verified
byte-for-byte reproducible by re-running `make savedefconfig` from the
committed file.
## Impact
Image size impact (`waveshare-rp2040-lcd-1.28:nsh`, same toolchain):
`nsh_main` baseline text/data/bss = 159464/900/10748 (171112 total);
nxinit build = 174740/904/8204 (183848 total). `RAM_SIZE` is 270336
(264 KiB SRAM), comfortably clear of both.
CMake build support for RP2040's `ETC_ROMFS` is a known pre-existing gap
(see `boards/arm/rp23xx/*/src/CMakeLists.txt`'s `# TODO`); left untouched
here to match that established precedent.
## Testing Build Host
```
$ ./tools/checkpatch.sh -c -u -m -g origin/master..HEAD
Used config files:
1: .codespellrc
✔️ All checks pass.
```
All 4 configs built cleanly with
`make PICO_SDK_PATH=<pico-sdk>` (arm-none-eabi-gcc 10.3.1):
| board | config | text/data/bss |
|---|---|---|
| waveshare-rp2040-lcd-1.28 | nsh | 174740/904/8204 |
| waveshare-rp2040-lcd-1.28 | usbnsh | 180680/752/11272 |
| waveshare-rp2040-zero | nsh | 174672/904/8272 |
| waveshare-rp2040-zero | usbnsh | 180552/752/11400 |
`waveshare-rp2040-zero` has no physical unit available to this contributor
(build-only verification for that board).
**Hardware bring-up on `waveshare-rp2040-lcd-1.28` (serial console, USB
CDC/ACM console, init.rc/ROMFS boot log, interactive shell) is still
pending** — the only physical unit is currently in concurrent use by a
parallel workstream on the same fork. This PR is opened as **draft** and
will be updated with real UART/USB console boot logs and shell output
before being marked ready for review.
## Related
Part of the RP2040 waveshare fastboot + nxinit + dual-partition bootloader
initiative (Stage 3 of 4).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]