Hi everyone,
I’m currently trying to integrate LittleFS with the i.MX RT1173 microcontroller in my custom project. To validate the setup, I also tested it using the EVK board (MIMXRT1170-EVK) and the LittleFS example from the SDK, but unfortunately, it’s not working there either.
Here’s what I’ve done so far:
Used the MCUXpresso SDK example for LittleFS.
Verified that the FlexSPI NOR flash is initialized correctly.
The example builds successfully, but the following error is coming.
LFS>> format yes
Error formatting LFS: 4294967268
LFS>>
Has anyone successfully run LittleFS on the i.MX RT1173 or the MIMXRT1170-EVK?
Are there any known issues or patches needed for this SDK example?
Is there a specific configuration required for the flash driver or clock setup?
Any guidance or working example reference would be greatly appreciated.
Thanks in advance!
Hi @Thusharahan,
What SDK version are you using? Have you debugged the example project to see what line of code throws an error? Are you certain that the jumper configurations of your EVK are set at their default state?
BR,
Edwin.
Hi @EdwinHz,
Thanks for your response.
I’m using the SDK version [2.16.000] for the i.MX RT1170.
Yes, I tried debugging the example and added trace prints inside the LittleFS API calls to see where it fails.
Here’s the log output I’m getting:
Copyright 2024 NXP
LFS>>
LFS>>
LFS>>
LFS>> format yes
lfs.c:5906:trace: lfs_format(200145E8, 20014668 {.context=20014308, .read=2000195D, .prog=200019DD, .erase=20001AA1, .sync=2000E5A5, .read_size=16, .prog_size=256, .block_size=4096, .block_count=1024, .block_cycles=100, .cache_size=256, .lookahead_size=16, .read_buffer=200148E4, .prog_buffer=200149E4, .lookahead_buffer=20014AE4, .name_max=0, .file_max=0, .attr_max=0})
lfs.c:4331:trace: lfs_format_: Starting format operation
lfs.c:4333:trace: lfs_format_: Initializing LFS
lfs.c:4339:trace: lfs_format_: lfs_init successful
lfs.c:4344:trace: lfs_format_: Creating free lookahead
lfs.c:4351:trace: lfs_format_: Free lookahead created
lfs.c:4355:trace: lfs_format_: Allocating root directory
lfs.c:4361:trace: lfs_format_: Root directory allocated
lfs.c:4373:trace: lfs_format_: Preparing superblock (version=131073, block_size=4096, block_count=1024)
lfs.c:4376:trace: lfs_format_: Committing superblock to root dir
lfs.c:4383:trace: lfs_format_: lfs_dir_commit (superblock) failed with err=4294967268
lfs.c:4410:trace: lfs_format_: Entering cleanup (err=4294967268)
lfs.c:4412:trace: lfs_format_: Format operation complete with err=4294967268
lfs.c:5925:trace: lfs_format -> 4294967268
Error formatting LFS: 4294967268
The EVK jumpers are set to their default configuration.
Best regards,
Thusharahan
Hi @EdwinHz ,
As a follow-up, while debugging further I noticed that the error occurs inside the following function in lfs.c:
static int lfs_dir_commit(lfs_t *lfs, lfs_mdir_t *dir,
const struct lfs_mattr *attrs, int attrcount) {
int orphans = lfs_dir_orphaningcommit(lfs, dir, attrs, attrcount);
if (orphans < 0) {
return orphans;
}
if (orphans) {
int err = lfs_fs_deorphan(lfs, false);
if (err) {
return err;
}
}
return 0;
}
From the trace output, it seems lfs_dir_commit() fails with error 4294967268 during the format operation:
lfs.c:4377:trace: lfs_format_: Committing superblock to root dir
lfs.c:4388:trace: lfs_format_: lfs_dir_commit (superblock) failed with err=4294967268
So far, it looks like the failure happens when writing the superblock to the root directory.
Best regards,
Thusharahan