cancel
Showing results for 
Search instead for 
Did you mean: 

problems with STM32H7_HAL and SDHC 32Gb

dresc
Associate II

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).

9 REPLIES 9

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dresc
Associate II

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.

You could diff the code, and failing that you could look at what data the DISKIO layer is returning

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Try increasing the ClockDiv, and reducing the slew-rate (speed) of the GPIO pins

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dresc
Associate II

for me this is a bug of STM32 for H7.

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...

0690X000009Z41KQAS.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

thanks, do you have a example to integrate FatFS 0.13 to my project?

Imen.D
ST Employee

Hello,

Do you mean that FatFs R0.13 release resolve this problem ?

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..