Skip to main content
Associate
January 20, 2025
Question

SD Card mounting error- FR_DISK_ERR, disk error occurred

  • January 20, 2025
  • 5 replies
  • 1055 views

I am using STM32L562 microcontroller. I am unable to interface it with sdcard using sdmmc and fatfs
my sd cards are- 8gb (formatted in fat32)[old], 32gb(unused)[new]. In both sd cards I am getting the same problem- disk error occurred (FR_DISK_ERR) it means disk is not initialized properly but I have checked the hardware and it has no problem, what should I do??

This topic has been closed for replies.

5 replies

AScha.3
Super User
January 20, 2025

Read here in forum (search sd card problem etc , my posts ...) , to see the "usual" problems and what to do.

Should solve your problem.

If you feel a post has answered your question, please click on " Best Answer ".
KhushJainAuthor
Associate
January 21, 2025

i have tried all the suggested solutions on different forums but it is still not working

 

AScha.3
Super User
January 21, 2025

So:

- whats your setup (in Cube) now for sdmmc  ? (show screens)

- How is your hardware now ? (What you tried/changed)?

- What you do in your software and which error you at which point? (what you tried else, to find out, why ?)

If you feel a post has answered your question, please click on " Best Answer ".
Andrew Neil
Super User
January 21, 2025

@KhushJain wrote:

I am getting the same problem- disk error occurred (FR_DISK_ERR) 


So have you stepped through the code to find exactly what is causing that error to be returned?

Have you used an oscilloscope and/or logic analyser to see what the hardware is actually doing?

 


@KhushJain wrote:

 I have checked the hardware and it has no problem, what should I do??


Post full hardware details for others to review?

Does a standard ST example on an ST board work?

 

PS:

What SD Card driver/middleware are you using?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
January 21, 2025

Failure tends to cascade. Instrument the sector IO, see which succeeds or fails and the point at which that gets reported at the top level. Usually a lot later.

Debug based on an understanding of what's actually failing

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