2019-07-23 08:31 AM
i want to open a file in a SD_Card (mode SD 4 bits wide bus)
fres=f_open(&fil, "fit5.txt", FA_OPEN_ALWAYS | FA_WRITE);
but:
1- the program work fine with SanDisk uSD 2GB. -> f_res=FR_OK
2- the program not work with Kingston uSDHC (gen 10) 32 GB. -> f_res=FR_NO_FILESYSTEM
thanks
any solution?
i'm using: STM32Cube_FW_H7_V1.4.0 (STM32H743ZI) and STM32CubeMx Version 5.2.1 (for trueStudio code generator).
2019-07-23 09:37 AM
Check ffconf.h enablement of _FS_EXFAT
#define _FS_EXFAT 1
/* This option switches support of exFAT file system. (0:Disable or 1:Enable)
/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1)
/ Note that enabling exFAT discards C89 compatibility. */
Check what FILE SYSTEM is actually on the card, FatFS won't support NTFS, for example.
2019-07-24 05:35 AM
the SD's format is FAT32.
with the STM32F407VGTZ the same program work fine with both cards.
_FS_EXFAT is 0 in my code and if i set to 1 then appear several compilation's error.
2019-07-24 05:44 AM
You could diff the code, and failing that you could look at what data the DISKIO layer is returning
2019-07-24 06:04 AM
Try increasing the ClockDiv, and reducing the slew-rate (speed) of the GPIO pins
2019-07-24 08:27 AM
for me this is a bug of STM32 for H7.
2019-07-24 08:52 AM
I've got cards from 8GB thru 400GB, and eMMC from 4GB thru 128GB working on the H7 using FatFS R0.13, although we might both agree that ST has some of the worst software QA testing on the planet currently. Pressing a button and expecting robust, functional, commercial grade code to drop out is probably a bit fanciful. I don't expect to be out of a job soon...
2019-07-24 09:02 AM
thanks, do you have a example to integrate FatFS 0.13 to my project?
2019-08-16 06:15 AM
Hello,
Do you mean that FatFs R0.13 release resolve this problem ?
Best Regards,
Imen
2019-08-16 06:51 AM
There seem to be several problems in play here.
What I can tell you, is that if you validate things by filling the media, and checking the content, R0.12 will break the file system. On the PC, CHKDSK will diagnose a multitude of failings within the file system's structures.
I think R0.13c is the most up to date, but R0.13b is significantly more fit-for-purpose than R0.12c from 2017