2025-03-01 8:35 AM - last edited on 2025-03-01 9:05 AM by Andrew Neil
Hi,
I use STM32Cube, STM32CubeIDE and my board is STM32F746. How do I update FATFS? The system is running version 0.12c. This is from 2017.
Why do I want to update it?
After inserting the SD card, I check the status and if the card is not formatted, I want to format it. I have tried everything I could find on the internet. I am obviously not the only one who has a problem with the SD card in STM32 systems.
The command I use is this:
res = f_mkfs((TCHAR const*) SDPath, FM_FAT32, 0, work, sizeof(work));
Of course, I have tried all possible parameters. I get a response that formatting is OK, but after moving the card to the computer there is no system on the card and I get a RAW response.
When the card is formatted in advance, everything works for me.
2025-03-01 9:04 AM - edited 2025-03-01 9:15 AM
What makes you think this problem will be solved by updating?
Is FF_USE_MKFS enabled in your project?
http://elm-chan.org/fsw/ff/doc/config.html#use_mkfs
http://elm-chan.org/fsw/ff/doc/mkfs.html
To update it, just replace the source files with later source files:
http://elm-chan.org/fsw/ff/archives.html
PS:
FatFS support forum: http://elm-chan.org/fsw/ff/bd/
2025-03-01 10:08 AM
thanks for the quick response.
in which directory should I replace the files?
if I do it in the project directory, it changes back to 0.12c when generating :(
In version 0.12c it is _USE_MKFS. And I have it set to 1
If I change it in the directory ...\STM32Cube\Repository\STM32Cube_FW_F7_V1.17.2\Middlewares\Third_Party\FatFs\
then there is a problem with the configuration. I open .ioc I find FATFS and there is version 0.12c. how do I change this too?
2025-03-01 10:17 AM
What Format is on the card originally? Is it EXFAT? Has that been enabled in the build?
The old version of FATFS has issues with large cards, but the new version has a different DISKIO layer, so that needs to modified.
If the new format isn't working it suggests the DISKIO is not working. Revalidate