cancel
Showing results for 
Search instead for 
Did you mean: 

FR_INT_ERR with FATFS (dir_sdi) function

TKou
Associate II

I am using STM32L1 MCU with SPI communication to SD card

I am using the FATFS library

f_mount, f_mkfs and f_getfree are going fine

but f_open returns an FR_INT_ERR

Did anyone face this issue before, or have an idea on how to fix it?

2 REPLIES 2

Make sure you *thoroughly* test your diskio layer, the file system will fail if the block device returns different or random stuff vs what was actually written before, and should be on the media. This means do some testing of the read/write, *outside* of the FatFs context.

Instrument the read/write, and perhaps track blocks vs checksums, so you can pin down why it has an internal failure. If you've followed point#1 you'd be able to audit what's going on with respect to data on the media.

The FatFs ST ships is not the most current, it has some issues with very large media (200-400 GB, EXFAT), but for the most part is pretty solid.

Make sure you SPI library manages multi-sector reads/writes properly, recall reporting issues with that a long time ago

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

The problem was wih FATFS configuration I had a 1024 Block-sized sd card so I only had to change the max sector size to 1024.

Thank you for your answer !