FatFs with nor flash memory MIMXRT1062

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

FatFs with nor flash memory MIMXRT1062

Jump to solution
2,478 Views
yamakatb
Contributor III

Hello,

 

On my custom board has QSPi flash for which I have to read / write via FatFS file system.

So, I'm trying to combine fsl_flexspi_nor_flash.c with FatFS diskio.c with reference to sdcard_fatfs of "SDK_2.7.0_EVK-MIMXRT1060".

However, I realized that f_mkdir failed, and that these were not enough to update certain pages.

Are there any SDKs or documentation available to help you update a specific page in a sector of Nor Flash memory?

Or tell me if there is another good way.

 

DRESULT nor_disk_write(uint8_t physicalDriveconst uint8_t *bufferuint32_t sectoruint8_t count)
{
    uint8_t writeCount;
    assert(count == 1U);

    if (physicalDrive != NORDISK)
    {
        return RES_PARERR;
    }

    /* Write according to fatfs sector size */
    for(writeCount = 0; writeCount < FF_MAX_SS / nor_Handle.bytesInPageSize; writeCount++)
    {
        if (Nor_Flash_Page_Program(&nor_Handle, (sector * FF_MAX_SS) + ( nor_Handle.bytesInPageSize * writeCount ), buffer + (nor_Handle.bytesInPageSize * writeCount)) < 0)
        {
            return RES_ERROR;
        }
    }
    return RES_OK;
}

 

Hardware Details
Board ;EVK-MIMXRT1060
Device :MIMXRT1062
SDK Details
SDK Version :2.7.0 (released 2019-12-19)
Host OS :Windows
Toolchain :IAR Embedded Workbench for ARM
Middleware  :FatFS, sdmmc stack
Reference
SDK_2.7.0_EVK-MIMXRT1060\middleware\fatfs
SDK_2.7.0_EVK-MIMXRT1060\boards\evkmimxrt1064\sdmmc_examples\sdcard_fatfs
SDK_2.7.0_EVK-MIMXRT1060\components\flash\nor\flexspi\fsl_flexspi_nor_flash.c

Labels (1)
0 Kudos
Reply
1 Solution
2,244 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your statement, it seems that the application code and file system both resides in the QSPI, in addition, the boot mode is XIP, is it right?
If yes, please place the application to run in the RAM as the littlefs_shell does.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
2,245 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your statement, it seems that the application code and file system both resides in the QSPI, in addition, the boot mode is XIP, is it right?
If yes, please place the application to run in the RAM as the littlefs_shell does.

TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply