FatFs with nor flash memory MIMXRT1062

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FatFs with nor flash memory MIMXRT1062

跳至解决方案
3,042 次查看
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

标签 (1)
0 项奖励
回复
1 解答
2,808 次查看
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 项奖励
回复
1 回复
2,809 次查看
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 项奖励
回复