boards/rp2040: switch waveshare nsh/usbnsh configs to nxinit entrypoint - #20151
Merged
Merged
Conversation
JianyuWang0623
force-pushed
the
rp2040/nxinit-init
branch
from
September 15, 2026 09:22
d1b8562 to
cfb7d38
Compare
acassis
previously approved these changes
Sep 15, 2026
Contributor
|
Strange, github is failing: I will restart that job: |
JianyuWang0623
force-pushed
the
rp2040/nxinit-init
branch
from
September 15, 2026 12:26
cfb7d38 to
ded0794
Compare
JianyuWang0623
force-pushed
the
rp2040/nxinit-init
branch
2 times, most recently
from
September 16, 2026 09:21
24812bc to
721ef90
Compare
xiaoxiang781216
approved these changes
Sep 17, 2026
Switch CONFIG_INIT_ENTRYPOINT from nsh_main to nxinit's init_main for the shell-capable configs (nsh, usbnsh) of waveshare-rp2040-zero and waveshare-rp2040-lcd-1.28. nsh now runs as a "console sh" service started by init.rc instead of being the top-level init task. Add etc/init.d/init.rc to the shared common/src RCSRCS, gated on CONFIG_ETC_ROMFS && CONFIG_SYSTEM_NXINIT, so one copy covers both boards, plus a .gitignore for the etctmp files Board.mk generates from it. The four defconfigs also set CONFIG_SYSTEM_NXINIT=y with its Kconfig deps, CONFIG_ETC_ROMFS=y and CONFIG_FS_ROMFS=y. nsh_main connected the CDC/ACM gadget itself via boardctl(BOARDIOC_USBDEV_CDCACM); init_main does not, so the usbnsh configs would otherwise come up with no USB console. Run sercon from init.rc and enable CONFIG_SYSTEM_CDCACM in those two defconfigs to keep that step. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
JianyuWang0623
force-pushed
the
rp2040/nxinit-init
branch
from
September 17, 2026 07:17
721ef90 to
b8f8448
Compare
xiaoxiang781216
approved these changes
Sep 17, 2026
acassis
approved these changes
Sep 18, 2026
acassis
marked this pull request as ready for review
September 18, 2026 11:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch
CONFIG_INIT_ENTRYPOINTfromnsh_mainto nxinit'sinit_mainforthe shell-capable configs of both
waveshare-rp2040-zeroandwaveshare-rp2040-lcd-1.28:nsh(UART console) andusbnsh(USB CDC/ACMconsole).
nshnow runs as a "console sh" service started byinit.rcinstead of being the top-level init task, matching the pattern already used
on rv-virt/esp32s3/qemu.
boards/arm/rp2040/common/src/Make.defs: addinit.rctoRCSRCS,gated on
CONFIG_ETC_ROMFS && CONFIG_SYSTEM_NXINIT, following the samepattern
boards/risc-v/qemu-rv/rv-virtuses. Both waveshare boards shareCONFIG_ARCH_BOARD_COMMON'scommon/src, so one copy ofinit.rccovers 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.shresolves directly through the existing builtin binfmt loader
(
apps/system/nsh'sPROGNAMEalready registers bothnshandsh),so no
CONFIG_LIBC_ENVPATH/CONFIG_FS_BINFSchanges are needed here(these boards don't set
CONFIG_LIBC_ENVPATH).boards/arm/rp2040/common/.gitignore: new, ignoring theetctmp/etctmp.cbuild byproducts thatboards/Board.mkgenerates frominit.rcunderBOARD_COMMON_DIR, matching the existingboards/risc-v/qemu-rv/rv-virt/src/.gitignoreprecedent.waveshare-rp2040-zeroandwaveshare-rp2040-lcd-1.28,each
nsh+usbnsh):CONFIG_INIT_ENTRYPOINT="init_main",CONFIG_SYSTEM_NXINIT=yplus its previously-unset Kconfig deps(
CONFIG_EXPERIMENTAL,CONFIG_LIBC_EXECFUNCS,CONFIG_SCHED_HAVE_PARENT,CONFIG_SCHED_CHILD_STATUS), andCONFIG_ETC_ROMFS=y/CONFIG_FS_ROMFS=yto shipinit.rcvia the standard/etcROMFSauto-mount (
sched/init/nx_bringup.c'snx_romfsetc()). Each defconfigregenerated with
kconfig-tweak+make savedefconfig; verifiedbyte-for-byte reproducible by re-running
make savedefconfigfrom thecommitted file.
Impact
Image size impact (
waveshare-rp2040-lcd-1.28:nsh, same toolchain):nsh_mainbaseline text/data/bss = 159464/900/10748 (171112 total);nxinit build = 174740/904/8204 (183848 total).
RAM_SIZEis 270336(264 KiB SRAM), comfortably clear of both.
CMake build support for RP2040's
ETC_ROMFSis a known pre-existing gap(see
boards/arm/rp23xx/*/src/CMakeLists.txt's# TODO); left untouchedhere to match that established precedent.
Testing Build Host
All 4 configs built cleanly with
make PICO_SDK_PATH=<pico-sdk>(arm-none-eabi-gcc 10.3.1):waveshare-rp2040-zerohas no physical unit available to this contributor(build-only verification for that board).
Hardware bring-up on
waveshare-rp2040-lcd-1.28(serial console, USBCDC/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).