feat(mklittlefs): add command to format littlefs filesystems

Add an NSH command to format a device with littlefs, analogous to
mkfatfs for FAT filesystems. The command unmounts the mount point,
then remounts with forceformat to format and mount in one step.

Enable the command on boards that use littlefs as primary storage
(airbrainh743 and kakuteh7v2), and document it in the airbrainh743
flight controller page as a recovery procedure for a corrupted
flash filesystem.

Usage: mklittlefs /dev/mtd0 /fs/flash
This commit is contained in:
Julian Oes
2026-04-22 21:30:46 +12:00
parent f9fdda1a29
commit 174a6aab6f
7 changed files with 146 additions and 0 deletions
@@ -71,6 +71,7 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_LED_CONTROL=y
CONFIG_SYSTEMCMDS_MFT=y
CONFIG_SYSTEMCMDS_MKLITTLEFS=y
CONFIG_SYSTEMCMDS_MTD=y
CONFIG_SYSTEMCMDS_NSHTERM=y
CONFIG_SYSTEMCMDS_PARAM=y