You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "fdcavalcanti (via GitHub)" <gi...@apache.org> on 2026/04/24 18:00:46 UTC
[I] [BUG] Issues on NXFFS [nuttx]
fdcavalcanti opened a new issue, #18803:
URL: https://github.com/apache/nuttx/issues/18803
### Description / Steps to reproduce the issue
Hello all!
I would like to report some issues with the NuttX wear-leveling FLASH file system (NXFFS). I'll try and be very brief on the description and how to replicate.
The `fstest` program fails on the first iteration after creating and deleting a file from the mount point.
On the Espressif CI, we test SPI Flash in all devices available on NuttX using four different file systems: `smartfs`, `littlefs`, `spiffs` and `nxffs`.
The test only fails for `nxffs` and it happens on all devices.
On this example, I cleared the flash and uploaded the test binary.
The test creates a file on `/data`, then deletes it and runs `fstest`. You can see that it fails to open files for writing.
```
---- boot ----
nsh> mount
/data type nxffs
/proc type procfs
nsh> echo "Espressif" > /data/esp.txt
nsh> cat /data/esp.txt
Espressif
nsh> rm /data/esp.txt
nsh> fstest -n 2 -o 10 -m /data
=== FILLING 1 =============================
ERROR: Failed to open file for writing: 22
File name: /data/v8xKNJW8E7fgewGMhS0kQkI
File size: 1655
Filled file system
Number of files: 6
Number deleted: 0
Directory:
1. Type[8]: File Name: PRMIRHz9ZwgHgakAejh
2. Type[8]: File Name: jbLT
3. Type[8]: File Name: WwWHiuUqCk4tOjT9NEtR
4. Type[8]: File Name: 1znKEEWzPcGJyrfEpylQLGn8bT
5. Type[8]: File Name: 9CBmwAHkVZqmYCJFs0Y
6. Type[8]: File Name: E0SSae6eriB1tdTW
Total file size: 20783
ERROR: Bad CRC: -2100950977 vs 1413162872
File name: /data/1znKEEWzPcGJyrfEpylQLGn8bT
File size: 2111
ERROR: Failed to read a file: 3
File name: /data/1znKEEWzPcGJyrfEpylQLGn8bT
File size: 2111
ERROR: Failed to verify files
Number of files: 6
Number deleted: 0
nsh> echo $?
1
nsh>
```
To reproduce this binary on ESP32-S3 (its similar for other devices):
- ./tools/configure.sh esp32s3-devkit:spiflash
- Enable NXFFS on board bringup and FSTEST:
```
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_ESP32S3_MERGE_BINS=y
CONFIG_ESP32S3_SPIFLASH_NXFFS=y
CONFIG_ESP32S3_SPIFLASH_SMARTFS=n
CONFIG_ESP32S3_SPI_FLASH_DONT_USE_ROM_CODE=y
CONFIG_NDEBUG=n
CONFIG_TESTING_FSTEST=y
CONFIG_TESTING_FSTEST_STACKSIZE=8192
```
I would appreciate if anyone could assist on debugging this issue, if possible even on a different board.
Thanks all,
Filipe
### On which OS does this issue occur?
[OS: Linux]
### What is the version of your OS?
Linux Mint 22
### NuttX Version
master
### Issue Architecture
[Arch: risc-v]
### Issue Area
[Area: File System]
### Host information
_No response_
### Verification
- [x] I have verified before submitting the report.
--
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: commits-unsubscribe@nuttx.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] Issues on NXFFS [nuttx]
Posted by "ankohuu (via GitHub)" <gi...@apache.org>.
ankohuu commented on issue #18803:
URL: https://github.com/apache/nuttx/issues/18803#issuecomment-4397126592
<img width="879" height="524" alt="Image" src="https://github.com/user-attachments/assets/aedca3d8-1280-4c31-8723-d777c718515e" />
I tried to reproduce this locally on my DNESP32S3 board with 16MB flash, but I have not been able to reproduce the failure so far.
I ran the test multiple times and all runs passed:
```
Final memory usage:
VARIABLE BEFORE AFTER DELTA
======== ======== ======== ========
arena 5c9bc 5c9bc 0
ordblks 2 2 0
mxordblk 54028 54028 0
uordblks 85b4 85b4 0
fordblks 54408 54408 0
File system tests done... OK: 4, FAILED: 0
```
<details>
<summary>make host_info</summary>
Host system OS:
Ubuntu 24.04.4 LTS Linux ankohuu-pb16250 6.17.0-1017-oem #17-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 27 13:48:03 UTC 2026 x86_64 x86_64
Toolchain version:
clang: Not found
gcc: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
xtensa-esp32-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
xtensa-esp32s2-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
xtensa-esp32s3-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
riscv-none-elf-gcc: Not found
riscv32-esp-elf-gcc: Not found
riscv64-unknown-elf-gcc: riscv64-unknown-elf-gcc (13.2.0-11ubuntu1+12) 13.2.0
</details>
BTW, should the label be `Arch: xtensa` instead?
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] Issues on NXFFS [nuttx]
Posted by "fdcavalcanti (via GitHub)" <gi...@apache.org>.
fdcavalcanti commented on issue #18803:
URL: https://github.com/apache/nuttx/issues/18803#issuecomment-4428311792
Hi @ankohuu thanks for the test! Did you replicate exactly like I showed?
If I run the fstest only it works, the failure occurs in this specific sequence:
```
nsh> mount
/data type nxffs
/proc type procfs
nsh> echo "Espressif" > /data/esp.txt
nsh> cat /data/esp.txt
Espressif
nsh> rm /data/esp.txt
nsh> fstest -n 2 -o 10 -m /data
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org