Skip to main content
jlchoobs
Associate III
April 18, 2012
Question

Where is the UsbMassStorage Examples / Supt for stm32f4xx ? - Solved

  • April 18, 2012
  • 35 replies
  • 5341 views
Posted on April 18, 2012 at 06:58

I have an obvious question :

How do I implement SDCard as MassStorage on the Stm32f4Discovery Board ?

Why is there Examples of this for the stm32F103 but not for the stm32F4discovery ?

The wonderful 22examples for the Discovery are a lot less than the stm32f103 examples present.

It seems like it should be a simple modifying of code.

But, I find no examples or support for this anywhere at Stm or on the internet (besides my site).

Has Anybody tried this Project yet ?

#stm32f4discovery #stm3240g #epic-fail #msc
This topic has been closed for replies.

35 replies

jlchoobs
jlchoobsAuthor
Associate III
April 18, 2012
Posted on April 18, 2012 at 10:17

jlchoobs
jlchoobsAuthor
Associate III
April 20, 2012
Posted on April 20, 2012 at 13:21

See Mass Storage Project :

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

jlchoobs
jlchoobsAuthor
Associate III
April 24, 2012
Posted on April 24, 2012 at 14:38

I TESTED a WORKING Code Version on my Stm32F4Discovery Board for USB MSC Mass Storage with an SDCard. 

Thank you to the User who sent me the Code.

So, my Hardware implementation is Debugged.

However, the Code is Keil Library Code - and does Not Compile under other Compilers.

So, this will Not compile for Gcc, or Attolic, etc.

Has anybody tried the Code that I Uploaded above on previous posting ?

This Code should be close to Working on the Stm32f4Discovery Board;

 the Hardware configuration is the same as the Stm3240g Board - as is the Code - but only with the Clock changes.

It connects as an USB Mass Storage Device on Windows - but Windows then reports back that 'Mass Storage Device does not start'.
jlchoobs
jlchoobsAuthor
Associate III
April 25, 2012
Posted on April 25, 2012 at 09:13

Problem solved.

- Use Stm3240g Fw 2.1.0

- HFE needs be set to 8000000

- PLL_M needs be set to 8

- Change SD_Detect from PH13 to PH1 or always Card Present.

- LCD and LOG function calls can be commented out.

- Change target to Stm32f4Discovery / Stm32F407VG

danish_enchanting
Visitor II
June 16, 2012
Posted on June 16, 2012 at 16:27

I am using st discovery kit. connected a microsd card with the pinouts you showed on your stm32 geeks projects page. but i no success. i downloaded stm3240g-eval board firmware. changed the PLL_M to 8. but i dont know how to change HFE and what it is.

Please help me out.

Tell me what HFE is and how to change. and also tell me which project to use as there are multiple USB projects in the firmware. Also note that I am using Keil as tool.

Your help will be appreciated.

Tesla DeLorean
Guru
June 16, 2012
Posted on June 16, 2012 at 19:10

HSE High Speed External

MSC Mass Storage Controller

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
danish_enchanting
Visitor II
June 17, 2012
Posted on June 17, 2012 at 16:57

where can i change it (HSE)?

Also tell me which MSC to use device host or otg?

Tesla DeLorean
Guru
June 17, 2012
Posted on June 17, 2012 at 17:19

The Discovery board uses a 8 MHz external crystal, not 25 MHz, you'll need to fix that.

HSE_VALUE

PLL_M

STM32_USB-Host-Device_Lib_V2.1.0\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c

STM32_USB-Host-Device_Lib_V2.1.0\Project\USB_Device_Examples\MSC\MDK-ARM

You'll need to port a couple of the eval board specific settings (LED, pins, etc), remove the LCD stuff, and the calls thereto.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
danish_enchanting
Visitor II
June 18, 2012
Posted on June 18, 2012 at 18:12

thanks

Can you please tell me where are these calls for LCD and LED. Also tell me what are those changes required.

What happens if i ignore it and try to run.

Tesla DeLorean
Guru
June 18, 2012
Posted on June 18, 2012 at 18:40

What happens if i ignore it and try to run.

You'll learn if it works or not, or if it clashes with your hardware. I chose to skip this step.

Can you please tell me where are these calls for LCD and LED. Also tell me what are those changes required.

No not really, I pruned the extraneous files from the project (ie all the stm324xg_eval_xxx files unrelated to SDIO SD). You could use ''Find in Files'' on LCD and LED references. You could fix the compiler errors as they occur.

It would take me longer to document it that it took to do. I could zip up my Yagarto project if it would help, but that is predicated on having a suitable build environment.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..