JianyuWang0623 opened a new pull request, #19946:
URL: https://github.com/apache/nuttx/pull/19946

   ## Summary
   - The adb and txtable defconfigs already ran nxinit (init_main) as system 
init instead of nsh_main (see 73c949c87e5). This switches the remaining 17 
lckfb-szpi-esp32s3 defconfigs (camera, es7210, fastboot, fastboot_tcp, gc0308, 
gpio, lcd, lvgl, nsh, pca9557, psram, pwm, qmi8658, sdmmc, usb_device, uvc, 
vncviewer) to the same entrypoint, for consistency across the whole board.
   - For each defconfig: CONFIG_INIT_ENTRYPOINT switched to "init_main". The 
default init and nsh stacks overflow at runtime on this target: init_main 
overflows a smaller stack (observed near-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"; the nsh console service also crashes in getumask 
while running "ps" because its stack is too small to reach the procfs read 
path. CONFIG_INIT_STACKSIZE and CONFIG_SYSTEM_NSH_STACKSIZE are both raised to 
8192 to fix this. CONFIG_SYSTEM_NXINIT=y is added with its Kconfig dependencies 
(EXPERIMENTAL, LIBC_EXECFUNCS, SCHED_CHILD_STATUS -> SCHED_HAVE_PARENT), and 
missing ETC_ROMFS/FS_ROMFS are added where needed to ship init.rc.
   - nsh keeps running, just as a console service started by init.rc 
(boards/xtensa/esp32s3/common/src/etc/init.d/init.rc) instead of the top-level 
init, same as the existing adb/txtable configs.
   
   ## Impact
   - Affects only lckfb-szpi-esp32s3 board defconfigs. No change to shared 
arch/board source, no ABI/API changes. Slightly higher init/nsh stack usage 
(8192 bytes each) on this board only.
   
   ## Testing
   Build Host: Linux x86_64, xtensa-esp32s3-elf-gcc 12.2.0 (ESP-IDF toolchain)
   Target: esp32s3 / lckfb-szpi-esp32s3 (all 20 configs)
   
   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`. 
tools/checkpatch.sh passes on the diff.
   
   Flashed nsh and es7210 to real hardware (lckfb-szpi-esp32s3, MAC 
a0:85:e3:f4:43:30) and captured actual runtime output:
   
   nsh config — flash log:
   
   ```
   esptool.py v4.8.1
   Serial port /dev/ttyUSB0
   Chip is ESP32-S3 (QFN56) (revision v0.2)
   MAC: a0:85:e3:f4:43:30
   Configuring flash size...
   Auto-detected Flash size: 16MB
   Flash will be erased from 0x00000000 to 0x00033fff...
   Compressed 212196 bytes to 105049...
   Wrote 212196 bytes (105049 compressed) at 0x00000000 in 2.1 seconds
   Hash of data verified.
   Hard resetting via RTS pin...
   ```
   
   nsh config — serial console after reset (UART0, 115200 8N1):
   
   ```
   nsh> ps
     TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK        
    STACK COMMAND
       0     0     0   0 FIFO     Kthread   - Ready              
0000000000000000 0003040 Idle_Task
       2     2     0 100 RR       Task      - Waiting  Semaphore 
0000000000000000 0008120 init_main
       3     3     2 100 RR       Task      - Running            
0000000000000000 0008144 sh
   ```
   
   init_main (PID 2) is running as the root init and is the parent of the nsh 
console service `sh` (PID 3), confirming nxinit is in control of the boot 
sequence.
   
   es7210 config — flash log:
   
   ```
   esptool.py v4.8.1
   Serial port /dev/ttyUSB0
   Chip is ESP32-S3 (QFN56) (revision v0.2)
   MAC: a0:85:e3:f4:43:30
   Auto-detected Flash size: 16MB
   Flash will be erased from 0x00000000 to 0x00045fff...
   Compressed 286432 bytes to 172360...
   Wrote 286432 bytes (172360 compressed) at 0x00000000 in 3.0 seconds
   Hash of data verified.
   Hard resetting via RTS pin...
   ```
   
   es7210 config — via adb after reset:
   
   ```
   $ adb -s 1234 shell uname -a
   NuttX 13.0.1-RC0 73ad366f45c Aug 24 2026 14:46:29 xtensa lckfb-szpi-esp32s3
   
   $ adb -s 1234 shell ps
     TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK        
     STACK    USED FILLED COMMAND
       0     0     0   0 FIFO     Kthread   - Ready              
0000000000000000  0002992 0000848  28.3%  Idle_Task
       1     0     0 224 RR       Kthread   - Waiting  Semaphore 
0000000000000000  0008056 0000976  12.1%  hpwork
       2     0     0 100 RR       Kthread   - Waiting  Semaphore 
0000000000000000  0008064 0000624   7.7%  lpwork
       4     4     0 100 RR       Task      - Waiting  Semaphore 
0000000000000000  0008080 0005632  69.7%  init_main
       5     5     4 100 RR       Task      - Waiting  Semaphore 
0000000000000000  0008096 0001184  14.6%  sh
       6     6     4 100 RR       Task      - Ready              
0000000000000000  0008088 0001088  13.4%  adbd
       8     8     6 100 RR       Task      - Running            
0000000000000000  0008080 0002432  30.0%  sh -c ps
   ```
   
   init_main (PID 4) is the parent of both the console `sh` (PID 5) and `adbd` 
(PID 6), matching init.rc's `on init` service list (console, adbd).
   
   The remaining 15 changed defconfigs (camera, fastboot, fastboot_tcp, gc0308, 
gpio, lcd, lvgl, pca9557, psram, pwm, qmi8658, sdmmc, usb_device, uvc, 
vncviewer) were build-verified only in this pass (not flashed/run on hardware — 
no dedicated peripherals like camera/LCD/touch were wired up for each one).
   


-- 
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]

Reply via email to