Skip to main content
Visitor II
March 10, 2022
Question

Access SD Card via USB (MSC) results in "Please insert a disc into USB Drive"

  • March 10, 2022
  • 1 reply
  • 2939 views

I have an STM32L4R5ZI-P board. I have a SD Card connected via a 4-bit SDMMC (I'm using a Pmod SD Card Module).

I can successfully read and write to the SD Card using FatFS.

I have set up the USB_DEVICE and USB_OTG_FS as described here https://controllerstech.com/stm32-usb-msc/

When I connect the micro USB connector at the bottom of the board to my Windows PC I get a "Please insert a disc into USB Drive (F:).". It doesn't look like any memory size, or anything is passed to my PC.

The example worked without any other modification on the video.

Any ideas?

    This topic has been closed for replies.

    1 reply

    Graduate II
    March 10, 2022

    Perhaps talk to the people on that site?

    Not sure I like his wiring diagram. The boards look to have pull-ups, no circuit diagram found

    https://digilent.com/reference/_media/pmod:pmod:pmodSD_rm.pdf

    If it doesn't see media, perhaps you should look at how you've got the Card Detect pin of the socket wired, and how that's handled on the STM32 side. Typically these switch to ground when the cards are inserted, but you should check/confirm what this design does.

    JDonn.1Author
    Visitor II
    March 10, 2022

    Hi @Community member​,

    I have pull-ups on Data0, Data1, Data2, Data3 and CMD for the SDMMC (took a while to figure out why it wasn't working). Chip Select is connected to GND currently and I can read/write in the main code using FatFS.

    Graduate II
    March 10, 2022

    Ok, but the message is that on the PC side it's receiving a "MEDIUM NOT READY/PRESENT" type sense code from the MSC. The MSC Class tends to expect "Removable Media" devices to be attached.

    You need to look at how that's plumbed and coded, end-to-end.

    Like I said, the Card Detect pins on the sockets tend to be switches, you wire these to a GPIO, and the code in the STM32 checks the state of the GPIO to establish if a card is in the socket, or not.

    You shouldn't need pull-ups if they are already soldered on the back side of the adapter board.

    0693W00000Kc9blQAB.jpg