Skip to main content
TKou
Associate II
November 15, 2019
Question

FR_INT_ERR with FATFS (dir_sdi) function

  • November 15, 2019
  • 2 replies
  • 2608 views

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?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
November 15, 2019

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
TKou
TKouAuthor
Associate II
January 10, 2020

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 !