hello,
Trying to migrate an old project to latest code. I have this config
after migration.
$ ag LITTLEFS .config
1928:CONFIG_FS_LITTLEFS=y
1929:CONFIG_FS_LITTLEFS_PROGRAM_SIZE_FACTOR=1
1930:CONFIG_FS_LITTLEFS_READ_SIZE_FACTOR=1
1931:CONFIG_FS_LITTLEFS_BLOCK_SIZE_FACTOR=1
1932:CONFIG_FS_LITTLEFS_CACHE_SIZE_FACTOR=4
1933:CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE=0
1934:CONFIG_FS_LITTLEFS_BLOCK_CYCLE=200
1935:CONFIG_FS_LITTLEFS_NAME_MAX=32
1936:CONFIG_FS_LITTLEFS_FILE_MAX=2147483647
1937:CONFIG_FS_LITTLEFS_ATTR_MAX=1022
I can not mount a blank mtd partition on a sst26, cpu is stm32f429
I see make.defs has version 2.5.1
and cmakelists has version 2.4.0
So much for modern build systems, nuttx is not rigorous enough to
maintain both in sync, as warned by me and others when people wanted cmake.
Here is what happens at runtime with 2.4.0 (fs/littlefs/Make.defs
changed manually and nuttx rebuilt):
NuttShell (NSH) NuttX-12.4.0
nsh> mount -t littlefs -o forceformat /dev/storage /storage
find_blockdriver: pathname="/dev/storage"
find_blockdriver: /dev/storage is a MTD
lfs_format: lfs_format(0x200088e8, 0x2000889c {.context=0x20008858,
.read=0x802ef89, .prog=0x802f01d, .erase=0x802f0b1, .sync=0x802f12f,
.read_size=256, .prog_size=256, .block_size=4096, .block_count=1536,
.block_cycles=200, .cache_size=1024, .lookahead_size=192,
.read_buffer=0, .prog_buffer=0, .lookahead_buffer=0, .name_max=0,
.file_max=0, .attr_max=0})
sst26_bread: startblock: 2010 nblocks: 1
sst26_read: offset: 00201000 nbytes: 256
sst26_read: return nbytes: 256
sst26_erase: startblock: 0200 nblocks: 1
sst26_sectorerase: sector: 0200
sst26_writeenable: Enabled
_assert: Current Version: NuttX 12.4.0 d4d49e9645-dirty Mar 19 2024
01:04:47 arm
_assert: Assertion failed panic: at file: armv7-m/arm_hardfault.c:175
task: nsh process: nsh 0x801b7c5
up_dump_register: R0: R1: R2: 0001 R3: 0020
up_dump_register: R4: R5: R6: FP:
up_dump_register: R8: SB: SL: R11:
up_dump_register: IP: 8000 SP: 20007ac8 LR: 0803a101 PC: 0803a11e
up_dump_register: xPSR: 2100 PRIMASK: 0001 CONTROL:
up_dump_register: EXC_RETURN: fff9
dump_stacks: ERROR: Stack pointer is not within the stack
dump_stack: User Stack:
dump_stack: base: 0x8050749
dump_stack: size: 2000
That is definitely not a good stack pointer. LFS 2.4 does not work.
.name_max=0, .file_max=0, .attr_max=0 are very suspicious.
Trying again with 2.5.1 I get this:
NuttShell (NSH) NuttX-12.4.0
nsh> mount -t littlefs -o forceformat /dev/storage /storage
find_blockdriver: pathname="/dev/storage"
find_blockdriver: /dev/storage is a MTD
lfs_format: lfs_format(0x200088e8, 0x2000889c {.context=0x20008858,
.read=0x802ef89, .prog=0x802f01d, .erase=0x802f0b1, .sync=0x802f12f,
.read_size=256, .prog_size=256, .block_size=4096, .block_count=1536,
.block_cycles=200, .cache_size=1024, .lookahead_size=192,
.read_buffer=0, .prog_buffer=0, .lookahead_buffer=0, .name_max=0,
.file_max=0, .attr_max=0})
sst26_bread: startblock: 2010 nblocks: 1
sst26_read: offset: 00201000 nbytes: 256
sst26_read: return nbytes: 256
sst26_erase: startblock: 0200 nblocks: 1
sst26_sectorerase: sector: 0200
sst26_writeenable: Enabled
sst26_waitwritecomplete: Complete
sst26_sectorerase: Erased
sst26_bread: startblock: 2001 nblocks: 1
sst26_read: offset: 00200100 nbytes: 256
sst26_read: return nbytes: 256
sst26_bwrite: startblock: 2000 nblocks: 1
sst26_pagewrite: page: 2000 offset: 0020
sst26_writeenable: Enabled
sst26_waitwritecomplete: Complete
sst26_pagewrite: Written
sst26_ioctl: cmd: 1293
sst26_ioctl: return -25
sst26_bread: startblock: 2000 nblocks: 1
sst26_read: offset: 0020 nbytes: 256
sst26_read: return nbytes: 256
sst26_erase: startblock: 0201 nblocks: 1
sst26_sectorerase: sector: 0201
sst26_writeenable: Enabled
sst26_waitwritecomplete: Complete
sst26_sectorerase: Erased
sst26_bread: startblock: 2011 nblocks: 1
sst26_read: offset: 00201100 nbytes: 256
sst26_read: return nbytes: 256
sst26_bwrite: startblock: 2010 nblocks: 1
sst26_pagewrite: page: 2010 offset: 00201000
sst26_writeenable: Enabled
sst26_waitwritecomplete: Complete
sst26_pagewrite: Written
sst26_ioctl: cmd: 1293
sst26_ioctl: return -25
sst26_bread: startblock: 2010 nblocks: 1
sst26_read: offset: 00201000 nbytes: 256
sst26_read: return nbytes: 256
sst26_bread: startblock: 2000 nblocks: 1
sst26_read: offset: 0020 nbytes: 256
sst26_read: return nbytes: 256
sst26_bread: startblock: 2010 nblocks: 1
sst26_read: offset: 00201000 nbytes: 256
sst26_read: return nbytes: 256
sst26_bread: startblock: 2011 nblocks: 4
sst26_read: offset: 00201100 nbytes: 1024
sst26_read: return nbytes: 1024
lfs_format: lfs_format -> 0
lfs_mount: lfs_mount(0x200088e8, 0x2000889c {.context=0x20008858,
.read=0x802ef89, .prog=0x802f01d, .erase=0x802f0b1, .sync=0x802f12f,