Skip to main content
Associate
Apr 4, 2024 6:17 AM UTC
Solved

MSC with sd card configuration

I'm encountering an issue while attempting to configure my STM3240G-EVAL board to function as a “Mass Storage Device” with a microSD as Storage.

I used the MX configurator and followed tutorials but encountered the same issue every time. I can compile but if I connect the board via USB to my computer no device is detected.

 

Here's a breakdown of my configuration in MX:

SDIO and DMA:

  • SDIO is in “SD 4 bits Wide bus”-
  • DMA2 is active (SDIO_RX to DMA2 Stream 3 and SDIO_TX to DMA2 Stream 6)
  •  SDIO global interrupts are enable.
  • I tried different SDIOCLK clock divide factors (PCLK2 are 84MHz)

MSC:

  • USB_OTG_FS is “Device_Only”
  • Class for FS IP in USB_DEVICE is set to “Mass Storage Class”.

 

the other options are untouched.

 

Did I miss something or had somebody the same issue?

This topic has been closed for replies.
newbieBest answer
Associate
Apr 5, 2024 7:01 AM UTC

Hello @FBL 

I tried as USB host but it still not work.

One more time for me to understand.

I want to use my board as an USB-adapter for a microSD. if I connect the board to my computer the microSD will appear as drive on my computer so I can use it.

I was thinking in that case the board must be configured as device or did I missunderstood this?

6 replies

STTwo-32
ST Technical Moderator
Apr 4, 2024 6:38 AM UTC

Hello @newbie and welcome to the ST Community :smiling_face_with_smiling_eyes:.

First, you should use a data cable for communication not just a charging one.

Second, try using other COM ports of your PC.

Third, connect your board using the connector CN21 (ST-LINK/V2 connector) and not just any connector.

Best Regards.

STTwo-32 

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
newbieAuthor
Associate
Apr 4, 2024 9:01 AM UTC

Hello @STTwo-32 

I use a data cable and the COM ports are working fine as well.

for the connection I use the CN8 USB OTG FS connector. 

 

STTwo-32
ST Technical Moderator
Apr 4, 2024 9:51 AM UTC

To connect, you have to use the CN21 (ST-LINK/V2 connector) to connect your board using ST-Link.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
ST Technical Moderator
Apr 4, 2024 3:09 PM UTC

Hello @newbie 

 

> if I connect the board via USB to my computer no device is detected.

You are using STM32 MCU as host ! 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
newbieAuthorBest answer
Associate
Apr 5, 2024 7:01 AM UTC

Hello @FBL 

I tried as USB host but it still not work.

One more time for me to understand.

I want to use my board as an USB-adapter for a microSD. if I connect the board to my computer the microSD will appear as drive on my computer so I can use it.

I was thinking in that case the board must be configured as device or did I missunderstood this?