2024-08-26 05:18 AM - edited 2024-08-26 05:19 AM
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:
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.
2024-08-29 10:22 PM
Is there no one to help us with this?
Has no one tried this yet?
Or Is this not at all possible?
2024-08-30 03:54 AM
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.
2024-08-30 04:51 AM
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!
2024-08-30 06:30 AM
Hi,
according to the winbondw25n01gv datasheet it is mentioned in the section 8.2.11
If internal ECC algorithm is enabled, all 2,112 bytes of data will be accepted, but the bytes designated for
ECC parity bits in the extra 64 bytes section will be overwritten by the ECC calculation. If the ECC-E bit is
set to a 0 to disable the internal ECC, the extra 64 bytes section can be used for external ECC purpose or other usage.
So I think you should disable the ECC bit at the init phase.
regards
Haithem.
2024-09-05 04:21 AM
2024-09-06 12:29 AM
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.
2024-09-09 03:14 AM
Hi @KBhon.1,
@KBhon.1 wrote: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.
2024-09-09 04:17 AM
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.