cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103VE USB Mass storage speed issue

K_K
Associate III
Posted on April 27, 2016 at 10:55

Hi,

My application includes USB with mass storage class, I am using STM32F103VE MCU running at 72Mhz. Sandisk uSD(8GB, Class 10) used with SDIO  interface.

I have used USB MSC code from STM32F1 library

 

(STM32_USB-FS-Device_Lib_V4.0.0\Projects\Mass_Storage\MDK-ARM).

I have made my own device to test this software and it is working fine because I have tested USB HID and USB MSC.

My only problem is that I am getting ~50KB/S speed in USB MSC, how to increase it?

It would be really helpful if any one can give suggestion or workaround for it.

#fatfs #sdio #sd #stm32 #stm32 #usb #dma #massstorage
5 REPLIES 5
Walid FTITI_O
Senior II
Posted on April 27, 2016 at 13:04

Hi KVK, 

I  recommend the following references to get correct :

- ''MSC-Standalone'' example in

http://www2.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef1.html

library at this path:

STM32Cube_FW_F1_V1.3.0\Projects\STM3210E_EVAL\Applications\USB_Device\MSC_Standalone

-

USB on-the-go Host and device library that you can download at this

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257882#

with it user Manual

http://www2.st.com/content/ccc/resource/technical/document/user_manual/1c/6b/06/e6/19/6c/46/bf/CD00289278.pdf/files/CD00289278.pdf/jcr:content/translations/en.CD00289278.pdf

- Application note

http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/user_manual/DM00108129.pdf

''USB device library'' (6.2 Mass storage class)

-

http://www.st.com/web/en/catalog/tools/PF259242

tool that help you to generate your necessary initialization code for your project.

-Hannibal-
Posted on April 27, 2016 at 17:34

I'm not sure Cube is the answer to anything in the SDIO domain, there's a trail of people having issues. The OP isn't using it, and it will just add an extra dimension of fail/frustration.

As I suggested in the other thread, separate out and validate the SDIO functionality. You need to make sure the card has been walked into the 4-bit mode, and higher clock rates. If it is left at 400KHz 1-bit mode it is going to be a veritable sloth.

Can't say I've dealt with the F1 in years, on the F2/F4 platforms USB-FS + SDIO MSC can delivery 700-800 KBps

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
K_K
Associate III
Posted on April 29, 2016 at 06:37

Hi,

Thanks Clive, Thanks Hannibal.

I have checked SDIO functionalities and it is proper(i.e 4-bit mode with clock 24Mhz) in 

STM32_USB-FS-Device_Lib_V4.0.0\Projects\Mass_Storage\MDK-ARM

Also tried software generated from cubemx(additionally added USB_DISCONNECT GPIO), not working proper. PC is showing drive for that but it is asking to format the memory card.

Drive format window

is showing 32MB memory size instead of 2GB.

because of this issue I was unable to test speed by increasing packet size 

MSC_MEDIA_PACKET to 0x4000.

Also tried software suggested by Hannibal

STM32Cube_FW_F1_V1.2.0\Projects\STM3210E_EVAL\Applications\USB_Device\MSC_Standalone

).

Got speed nearly 80KB/S.

K_K
Associate III
Posted on April 30, 2016 at 10:23

Can anyone suggest what to do next?