Skip to main content
Graduate II
August 5, 2024
Solved

How to access a SD-Card connected by STM32 SDIO as a U-Disk by PC?

  • August 5, 2024
  • 3 replies
  • 1242 views

Hi there,

I am working on STM32F429BIT6, and I have a SD-Card connected.

Now, I want to copy some data between the PC and SD-Card by USB directly.

Is there any example or document?

Anything is welcome, thank you!

    This topic has been closed for replies.
    Best answer by Junde

    For MDK IDE, the USB related code must compiled by "MDK compiler V5", the binary by "MDK compiler V6" will NOT work!

    Demo reference: https://github.com/ShadowThree/STM32V6_extFlash_SDcard_FatFS_Udisk_Demo

     

    3 replies

    Graduate II
    August 5, 2024

    There should be a MSC USB Device example amongst those ib CubeF4, perhaps as Applications for EVAL or DISCO series boards that map operations to SDIO port.

    JundeAuthor
    Graduate II
    August 6, 2024

    @Tesla DeLorean  Thank you for your information!

    I find a example similar with my requirement at STM32Cube_FW_F4_V1.28.0\Projects\STM32F412G-Discovery\Applications\USB_Device\MSC_Standalone, I will read it carefully.

    JundeAuthor
    Graduate II
    August 7, 2024

    Hi, @Tesla DeLorean 

    I have read the example and this tutorial carefully.

    But my program always can't work, the code is stopped at USBD_GetEpDesc() because pdesc->bDescriptorType always NOT equals to USB_DESC_TYPE_ENDPOINT

    Junde_0-1723008719797.png

    I am not skillful at USB, but I can sure the hardware is work well, as I have a project can do that thins.

    If need, refer my project at attachment.

    Thanks for your help!

     

    JundeAuthorAnswer
    Graduate II
    August 19, 2024

    For MDK IDE, the USB related code must compiled by "MDK compiler V5", the binary by "MDK compiler V6" will NOT work!

    Demo reference: https://github.com/ShadowThree/STM32V6_extFlash_SDcard_FatFS_Udisk_Demo