apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.91k stars 1.18k forks source link

[BUG] nsh and SmartFS file system are not SMP-proof #13856

Open UAV-Pilot opened 1 month ago

UAV-Pilot commented 1 month ago

Description / Steps to reproduce the issue

1) On Pi Pico W board with Pi Pico SDK 2.0, setup a system with working flash SmartFS file system and without SMP, e.g., ./tools/configure.sh -l raspberrypi-pico-w:nsh-flash

2) verify that the following file creation, deletion and smart_test command work cd /flash echo Hello_NuttX > test2.txt cat test2.txt smart_test -w 2 /flash/test2.txt rm test2.txt

3) enable SMP and run ps or other command to verify that SMP is working ref: https://blog.mark-stevens.co.uk/2023/06/adding-smp-to-nuttx-on-the-raspberry-pi-picow/

4) try to re-run commands in step 2) notice that when executing file creation or deletion or smart_test command, nsh hangs. If there is a USB nsh and a telnet nsh, then both nsh hang.

Not sure if there is any other part of NuttX OS that is also not SMP-proof.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Windows 11 WSL2 Ubuntu 22.04.2

NuttX Version

NuttX 12.7.0-RC0 0976258-dirty Oct 4 2024 22:58:36 arm rasp

Issue Architecture

[Arch: arm]

Issue Area

[Area: OS Components]

Verification

xiaoxiang781216 commented 1 month ago

could you test on littlefs? so we can know whether is specific to smartfs.

UAV-Pilot commented 1 month ago

Created a related bug: https://github.com/apache/nuttx/issues/13882 (Flash file system creation process does not take configured parameters on Pi Pico #13882), don't know how to create a working littlefs. Note that in menuconfig, selecting RP2040_FLASH_FILE_SYSTEM (Configure a read/write filesystem on unused flash memory) will automatically select SmartFS.

jerpelea commented 1 month ago

@UAV-Pilot updates?