This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello, I am implementing a file system on data flash to write my firmware the spi data flash model is S25FL128SAGNFI003. Currently, I am using a FATFS file system that is compatible with TI RTOS the issue is my spi flash is not mounting with a logical drive. The flash is not formatted under FATFS so how can I format my spi flash because the f_mount function requires an SPI Flash to be formated under FATFS?
Hello Muhammad,
Please indicate what processor you are using.
Thank you,
~Leonard
Hi,
Reading S25FL128SAGNFI003 datasheet it is just a SPI flash memory, not a SD card. Why would you need the FATFS for a SPI flash? SPI Flash is just a memory with SPI interface but that is different from a SD card that can also operate in SPI mode. FATFS is normally needed for SD card type of storage device.
This article has some useful information about SPI flash vs SD card. https://forums.parallax.com/discussion/129414/when-to-use-sram-sd-card-spi-flash-and-eeprom
TivaWare provides utilities to access SPI flash. You can find the APIs in C:\ti\TivaWare_C_Series-2.2.0.295\utils/spi_flash.c
I think you also want to refer to your memory device datasheet for details about commands used to access their device.
the spi flash is already present in my system and I am uploading firmware by writing a sectors and pages now I want to write the same firmware with the file system.
In FATFS, the file system must be mounted before accessing the files and directories on the data flash. Each directory entry contains information about a single file, including the file name, extension, attributes, creation, file size, and starting cluster number. When we mount a FAT file system, the FATFS library reads the boot sector and the FAT tables from the drive into memory, and uses this information to locate the files and directories on the drive.
After the file system is mounted, then we can use various FATFS library functions (f_open, f_read, f_write)
so the issue is flash is not mounting either we have to format the data flash with fatfs which is technically quite difficult so Another method is we can erase the sectors and write the specific data bytes which will identify the supported file system. You can do it during initialization.
Hi,
Another method is we can erase the sectors and write the specific data bytes which will identify the supported file system. You can do it during initialization.
I understand what you want. However, after searching, we just don't have such an utility or library to format a FAT16 filesystem for a SPI flash. If you think you can recreate a FAT16 boot sector structure on your own then do let us know. I have no experience as to what efforts this will entail.
With that said, I find this article that maybe helpful.
https://www.mischianti.org/2022/11/21/stm32-add-spi-flash-memory-with-fat-fs/