cancel
Showing results for 
Search instead for 
Did you mean: 

MSC with sd card configuration

newbie
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
newbie
Associate II

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?

View solution in original post

6 REPLIES 6
STTwo-32
ST Employee

Hello @newbie and welcome to the ST Community 😊.

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.

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. 

 

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.

I use the CN21 for flashing my board and also for the MSC?

I thought the USB OTG FS and the HS where for the MSC function.

 

But still if I connect the board after flashing the board via CN21 or USB OTG FS I dont get a connection between my sd card and my computer

FBL
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

newbie
Associate II

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?