Skip to main content
Visitor II
January 20, 2025
Question

SD Card mounting error- FR_DISK_ERR, disk error occurred

  • January 20, 2025
  • 3 replies
  • 983 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.

    3 replies

    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.

    KhushJainAuthor
    Visitor II
    January 21, 2025

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

     

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

    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?

    Graduate II
    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