LittleFS integration issue with i.MX RT1173

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LittleFS integration issue with i.MX RT1173

670 Views
Thusharahan
Contributor II

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!

Tags (1)
0 Kudos
Reply
4 Replies

634 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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.

0 Kudos
Reply

599 Views
Thusharahan
Contributor II

 

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

Tags (1)
0 Kudos
Reply

541 Views
Thusharahan
Contributor II

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

Tags (1)
0 Kudos
Reply

412 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Thusharahan,

I tried running the example with the EVK, and on my side it works correctly every time. No error shows up. What BOOT MODE configuration are you using? Are you doing any memory configuration changed on the example code? More specifically, are you enabling XIP mod, for example? What is the schematic revision of your EVK? I tested it on REV C1 and it worked as intended.

BR,
Edwin.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2195019%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELittleFS%20integration%20issue%20with%20i.MX%20RT1173%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2195019%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3EI%E2%80%99m%20currently%20trying%20to%20%3CSTRONG%3Eintegrate%20LittleFS%20with%20the%20i.MX%20RT1173%20microcontroller%3C%2FSTRONG%3E%20in%20my%20custom%20project.%20To%20validate%20the%20setup%2C%20I%20also%20tested%20it%20using%20the%20%3CSTRONG%3EEVK%20board%20(MIMXRT1170-EVK)%3C%2FSTRONG%3E%20and%20the%20%3CSTRONG%3ELittleFS%20example%20from%20the%20SDK%3C%2FSTRONG%3E%2C%20but%20unfortunately%2C%20it%E2%80%99s%20not%20working%20there%20either.%3C%2FP%3E%3CP%3EHere%E2%80%99s%20what%20I%E2%80%99ve%20done%20so%20far%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EUsed%20the%20%3CSTRONG%3EMCUXpresso%20SDK%20example%3C%2FSTRONG%3E%20for%20LittleFS.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EVerified%20that%20the%20%3CSTRONG%3EFlexSPI%20NOR%20flash%3C%2FSTRONG%3E%20is%20initialized%20correctly.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EThe%20example%20builds%20successfully%2C%20but%20the%20following%20error%20is%20coming.%3C%2FP%3E%3CP%3E%3CSTRONG%3ELFS%26gt%3B%26gt%3B%20format%20yes%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EError%20formatting%20LFS%3A%204294967268%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ELFS%26gt%3B%26gt%3B%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EHas%20anyone%20successfully%20run%20LittleFS%20on%20the%20%3CSTRONG%3Ei.MX%20RT1173%20or%20the%20MIMXRT1170-EVK%3C%2FSTRONG%3E%3F%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EAre%20there%20any%20known%20issues%20or%20patches%20needed%20for%20this%20SDK%20example%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIs%20there%20a%20specific%20configuration%20required%20for%20the%20flash%20driver%20or%20clock%20setup%3F%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EAny%20guidance%20or%20working%20example%20reference%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2202066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LittleFS%20integration%20issue%20with%20i.MX%20RT1173%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2202066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256289%22%20target%3D%22_blank%22%3E%40Thusharahan%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20tried%20running%20the%20example%20with%20the%20EVK%2C%20and%20on%20my%20side%20it%20works%20correctly%20every%20time.%20No%20error%20shows%20up.%20What%20BOOT%20MODE%20configuration%20are%20you%20using%3F%20Are%20you%20doing%20any%20memory%20configuration%20changed%20on%20the%20example%20code%3F%20More%20specifically%2C%20are%20you%20enabling%20XIP%20mod%2C%20for%20example%3F%20What%20is%20the%20schematic%20revision%20of%20your%20EVK%3F%20I%20tested%20it%20on%20REV%20C1%20and%20it%20worked%20as%20intended.%3C%2FP%3E%0A%3CP%3EBR%2C%3CBR%20%2F%3EEdwin.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2196258%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LittleFS%20integration%20issue%20with%20i.MX%20RT1173%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196258%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F186731%22%20target%3D%22_blank%22%3E%40EdwinHz%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EAs%20a%20follow-up%2C%20while%20debugging%20further%20I%20noticed%20that%20the%20error%20occurs%20inside%20the%20following%20function%20in%20lfs.c%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Estatic%20int%20lfs_dir_commit(lfs_t%20*lfs%2C%20lfs_mdir_t%20*dir%2C%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20const%20struct%20lfs_mattr%20*attrs%2C%20int%20attrcount)%20%7B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20int%20orphans%20%3D%20lfs_dir_orphaningcommit(lfs%2C%20dir%2C%20attrs%2C%20attrcount)%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20if%20(orphans%20%26lt%3B%200)%20%7B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20return%20orphans%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20if%20(orphans)%20%7B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20int%20err%20%3D%20lfs_fs_deorphan(lfs%2C%20false)%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20if%20(err)%20%7B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20return%20err%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20return%200%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3E%7D%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFrom%20the%20trace%20output%2C%20it%20seems%20lfs_dir_commit()%20fails%20with%20error%204294967268%20during%20the%20format%20operation%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3Elfs.c%3A4377%3Atrace%3A%20lfs_format_%3A%20Committing%20superblock%20to%20root%20dir%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3Elfs.c%3A4388%3Atrace%3A%20lfs_format_%3A%20lfs_dir_commit%20(superblock)%20failed%20with%20err%3D4294967268%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ESo%20far%2C%20it%20looks%20like%20the%20failure%20happens%20when%20writing%20the%20superblock%20to%20the%20root%20directory.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EThusharahan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2195504%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LittleFS%20integration%20issue%20with%20i.MX%20RT1173%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2195504%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F186731%22%20target%3D%22_blank%22%3E%40EdwinHz%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThanks%20for%20your%20response.%3C%2FP%3E%3CP%3EI%E2%80%99m%20using%20the%3CSTRONG%3E%26nbsp%3BSDK%20version%20%5B2.16.000%5D%3C%2FSTRONG%3E%20for%20the%20i.MX%20RT1170.%3CBR%20%2F%3EYes%2C%20I%20tried%20debugging%20the%20example%20and%20added%20trace%20prints%20inside%20the%20LittleFS%20API%20calls%20to%20see%20where%20it%20fails.%3C%2FP%3E%3CP%3EHere%E2%80%99s%20the%20log%20output%20I%E2%80%99m%20getting%3A%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3ECopyright%202024%20NXP%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3ELFS%26gt%3B%26gt%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3ELFS%26gt%3B%26gt%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3ELFS%26gt%3B%26gt%3B%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3ELFS%26gt%3B%26gt%3B%20format%20yes%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A5906%3Atrace%3A%20lfs_format(200145E8%2C%2020014668%20%7B.context%3D20014308%2C%20.read%3D2000195D%2C%20.prog%3D200019DD%2C%20.erase%3D20001AA1%2C%20.sync%3D2000E5A5%2C%20.read_size%3D16%2C%20.prog_size%3D256%2C%20.block_size%3D4096%2C%20.block_count%3D1024%2C%20.block_cycles%3D100%2C%20.cache_size%3D256%2C%20.lookahead_size%3D16%2C%20.read_buffer%3D200148E4%2C%20.prog_buffer%3D200149E4%2C%20.lookahead_buffer%3D20014AE4%2C%20.name_max%3D0%2C%20.file_max%3D0%2C%20.attr_max%3D0%7D)%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4331%3Atrace%3A%20lfs_format_%3A%20Starting%20format%20operation%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4333%3Atrace%3A%20lfs_format_%3A%20Initializing%20LFS%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4339%3Atrace%3A%20lfs_format_%3A%20lfs_init%20successful%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4344%3Atrace%3A%20lfs_format_%3A%20Creating%20free%20lookahead%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4351%3Atrace%3A%20lfs_format_%3A%20Free%20lookahead%20created%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4355%3Atrace%3A%20lfs_format_%3A%20Allocating%20root%20directory%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4361%3Atrace%3A%20lfs_format_%3A%20Root%20directory%20allocated%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4373%3Atrace%3A%20lfs_format_%3A%20Preparing%20superblock%20(version%3D131073%2C%20block_size%3D4096%2C%20block_count%3D1024)%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4376%3Atrace%3A%20lfs_format_%3A%20Committing%20superblock%20to%20root%20dir%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4383%3Atrace%3A%20lfs_format_%3A%20lfs_dir_commit%20(superblock)%20failed%20with%20err%3D4294967268%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4410%3Atrace%3A%20lfs_format_%3A%20Entering%20cleanup%20(err%3D4294967268)%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A4412%3Atrace%3A%20lfs_format_%3A%20Format%20operation%20complete%20with%20err%3D4294967268%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3Elfs.c%3A5925%3Atrace%3A%20lfs_format%20-%26gt%3B%204294967268%3C%2FEM%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CEM%3EError%20formatting%20LFS%3A%204294967268%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20EVK%20jumpers%20are%20set%20to%20their%20default%20configuration.%3C%2FP%3E%3CP%3EBest%20regards%2C%3CBR%20%2F%3EThusharahan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2195270%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LittleFS%20integration%20issue%20with%20i.MX%20RT1173%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2195270%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256289%22%20target%3D%22_blank%22%3E%40Thusharahan%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EWhat%20SDK%20version%20are%20you%20using%3F%20Have%20you%20debugged%20the%20example%20project%20to%20see%20what%20line%20of%20code%20throws%20an%20error%3F%20Are%20you%20certain%20that%20the%20jumper%20configurations%20of%20your%20EVK%20are%20set%20at%20their%20default%20state%3F%3C%2FP%3E%0A%3CP%3EBR%2C%3CBR%20%2F%3EEdwin.%3C%2FP%3E%3C%2FLINGO-BODY%3E