Skip to main content
Explorer
August 26, 2024
Question

Issue with QSPI NAND Flash FILEX Driver Integration on STM32F469 (Azure RTOS)

  • August 26, 2024
  • 2 replies
  • 3717 views

Hello,
I am working on a project using an STM32F469 microcontroller, and I'm trying to interface a W25N01GV NAND flash memory over QSPI. I’m currently facing issues during the format phase while using FileX with LevelX NAND driver.

following is the configuration used while formatting:

 

 

 

 /* Format the NAND flash as FAT */
 status = fx_media_format(&nand_flash_disk,
 fx_stm32_levelx_nand_driver, /* Driver entry */
 (VOID *)CUSTOM_DRIVER_ID, /* NAND disk memory pointer */
 media_memory, /* Media buffer pointer */
 sizeof(media_memory), /* Media buffer size */
 "NAND_FLASH_DISK", /* Volume Name */
 1, /* Number of FATs */
 32, /* Directory Entries */
 0, /* Hidden sectors */
 65536, /* Total sectors */
 2048, /* Sector size */
							1, /* Sectors per cluster */
 1, /* Heads */
 1); /* Sectors per track */

 

 

 



1) The QSPI initialization seems to work fine, and I can read the flash ID: EFAA21 successfully.

2) When attempting to format the NAND flash using fx_media_format, the process fails with errors indicating that no new pages can be allocated (LX_NO_SECTORS and LX_SECTOR_NOT_FOUND). 


The software components I have selected in Azure RTOS are as shown in the image:

KBhon1_0-1724652940754.png


I also doubt if my implementation of W25NXX_Read_Spare_Area and W25NXX_Write_Spare_Area under lx_nand_driver_extra_bytes_get/ lx_nand_driver_extra_bytes_set.

Please help me in solving this issue. There are no examples available with SPI/QSPI NAND Flash. I have attached my custom driver and W25N C implementation files for reference. 

I really appreciate any help you can provide.

 

    This topic has been closed for replies.

    2 replies

    KBhon.1Author
    Explorer
    August 30, 2024

    Is there no one to help us with this?

    Has no one tried this yet?

    Or Is this not at all possible?

    ST Employee
    August 30, 2024

    Hi @KBhon.1

    We have an ongoing work to support the W25N01GXX NAND flash but through the STMod+ connector using the Flash 5 Click | Mikroe Once ready it will be published with details how to use it.

    you'll need, meanwhile, to be sure that your WB_SerialNAND_Sample_Code_LLD.c driver is fully validated.i.e check that you can write/read data on pages including the spare_areas.

     

    regards

    Haithem.

    KBhon.1Author
    Explorer
    August 30, 2024

    Hello @Haithem Rahmani,

    Thank you for your response.
    We have validated our driver files. We can read/write from the memory,
    however we are unable to read/write from spare area.

    Can you please point out where we did wrong?

    Thanks in advance!

    KBhon.1Author
    Explorer
    September 6, 2024

    Hi @Haithem Rahmani 

    We got the spare area read/write successfully working.
    However we were still unable to get FileX working properly. 

    We found that Azure FileX documentation is not in a mature state yet to start shifting our work to it and have shifted our focus from FileX to LFS and dhara which we got working very easily.


    We would like to see more examples and more documentation on Azure and its all other offerings. There is not enough documentation and examples to look for.

    I find it strange to see ST pushing Azure over classic CoreMW without providing proper documentation and examples, as can be seen in this photo. Also I found it very difficult to configure Azure and other offerings through IOC file. 

    KBhon1_0-1725607632267.png

     

    ST Employee
    September 9, 2024

    Hi @KBhon.1,


    @KBhon.1 wrote:

    Hi @Haithem Rahmani 

    We got the spare area read/write successfully working.

    Happy to hear that!

    However we were still unable to get FileX working properly. 

    Could you please provide more details, what are the issues you are facing?

    We found that Azure FileX documentation is not in a mature state yet to start shifting our work to it and have shifted our focus from FileX to LFS and dhara which we got working very easily.


    LFS may be easier to use and integrate, but it has its own filesystem format, thus it won't be interoperable with a PC (USBX/MSC class for example).

    regards
    Haithem.

    ST Employee
    September 9, 2024

    Hi @KBhon.1 

    to get LFS working  on NAND flash memories you'll need to keep builtin ECC enabled.

    https://github.com/littlefs-project/littlefs/issues/11#issuecomment-378313646

     

    regards

    Haithem.