nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[BUG] Several file utilities only occasually work

Open UAV-Pilot opened this issue 1 year ago • 2 comments

Description / Steps to reproduce the issue

On Pi Pico W board with Pi Pico SDK 2.0, setup a system with working flash SmartFS file system and USB console, e.g., ./tools/configure.sh -l raspberrypi-pico-w:nsh-flash reference raspberrypi-pico-w:usbnsh base configuration to add USB console or execute the following script:

#!/bin/bash

#kconfig-tweak --set-val CONFIG_BASE_DEFCONFIG "raspberrypi-pico-w:telnet-dirty"
kconfig-tweak --disable CONFIG_DEBUG_USB
kconfig-tweak --enable CONFIG_BOARDCTL_USBDEVCTRL
kconfig-tweak --disable CONFIG_DEV_CONSOLE
kconfig-tweak --enable CONFIG_SERIAL_REMOVABLE
kconfig-tweak --enable CONFIG_SERIAL_TXDMA
kconfig-tweak --enable CONFIG_SERIAL_RXDMA
kconfig-tweak --disable CONFIG_UART0_SERIAL_CONSOLE
kconfig-tweak --enable CONFIG_NO_SERIAL_CONSOLE
kconfig-tweak --enable CONFIG_USBDEV

# USB Device Controller Driver Options
kconfig-tweak --set-val CONFIG_USBDEV_EPBUFFER_ALIGNMENT 0
kconfig-tweak --enable CONFIG_USBDEV_SELFPOWERED
kconfig-tweak --set-val CONFIG_USBDEV_MAXPOWER 100
kconfig-tweak --set-val CONFIG_USBDEV_TRACE_INITIALIDSET 0

# USB Device Class Driver Options
kconfig-tweak --enable CONFIG_CDCACM
kconfig-tweak --enable CONFIG_CDCACM_CONSOLE
kconfig-tweak --enable CONFIG_CDCACM_HAVE_EPINTIN
kconfig-tweak --set-val CONFIG_CDCACM_EP0MAXPACKET 64
kconfig-tweak --set-val CONFIG_CDCACM_EPINTIN 1
kconfig-tweak --set-val CONFIG_CDCACM_EPINTIN_FSSIZE 64
kconfig-tweak --set-val CONFIG_CDCACM_EPBULKOUT 3
kconfig-tweak --set-val CONFIG_CDCACM_EPBULKOUT_FSSIZE 64
kconfig-tweak --set-val CONFIG_CDCACM_EPBULKIN 2
kconfig-tweak --set-val CONFIG_CDCACM_EPBULKIN_FSSIZE 64
kconfig-tweak --set-val CONFIG_CDCACM_NRDREQS 4
kconfig-tweak --set-val CONFIG_CDCACM_NWRREQS 4
kconfig-tweak --set-val CONFIG_CDCACM_BULKOUT_REQLEN 256
kconfig-tweak --set-val CONFIG_CDCACM_BULKIN_REQLEN 96
kconfig-tweak --set-val CONFIG_CDCACM_RXBUFSIZE 257
kconfig-tweak --set-val CONFIG_CDCACM_TXBUFSIZE 193
kconfig-tweak --set-val CONFIG_CDCACM_VENDORID 0x0525
kconfig-tweak --set-val CONFIG_CDCACM_PRODUCTID 0xa4a7
kconfig-tweak --set-val CONFIG_CDCACM_VENDORSTR "NuttX"
kconfig-tweak --set-val CONFIG_CDCACM_PRODUCTSTR "CDC/ACM Serial"

kconfig-tweak --enable CONFIG_NSH_USBCONSOLE
kconfig-tweak --set-val CONFIG_NSH_USBCONDEV "/dev/ttyACM0"
kconfig-tweak --set-val CONFIG_USBDEV_MINOR 0
kconfig-tweak --disable CONFIG_NSH_USBDEV_TRACE
kconfig-tweak --disable CONFIG_SYSTEM_CDCACM

The problem happens with df, free and also with ifconfig. The following is an example for df.

nsh> cd /flash
nsh> ls -l
/flash:
 -rwsrwsrwx          14 test
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Moun         0          0           0 /proc

nsh> df .
  Block    Number
  Size     Blocks       Used   Available Moun         0          0           0 /proc

nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounted on
  1024       1468         12        1456 /flash
     0 nsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Moun         0          0           0 /proc

nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounted on
  1024       1468         12        1456 /flash
     0 nsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounted on
  1024       1468         12        1456 /flash
     0          0          0           0 /proc

nsh> df .
  Block    Number
  Size     Blocks       Used   Available Moun         0          0           0 /proc

nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounted on
  1024       1468         12        1456 /flash
     0 nsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounted on
  1024       1468         12        1456 /flash
     0 nsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>
nsh> df .
  Block    Number
  Size     Blocks       Used   Available Mounnsh>

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: File System]

Verification

  • [X] I have verified before submitting the report.

UAV-Pilot avatar Oct 06 '24 23:10 UAV-Pilot

could you switch to littlefs and compare the result?

xiaoxiang781216 avatar Oct 07 '24 07:10 xiaoxiang781216

Created a related bug: https://github.com/apache/nuttx/issues/13882 (Flash file system creation process does not take configured parameters on Pi Pico https://github.com/apache/nuttx/issues/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.

UAV-Pilot avatar Oct 07 '24 18:10 UAV-Pilot

The garbled output above looks like #16305 to me?

(i.e. the above broken output probably does not happen via telnet)

Maybe close as a (misleading) duplicate?

sumpfralle avatar Sep 10 '25 18:09 sumpfralle