cancel
Showing results for 
Search instead for 
Did you mean: 

USB Mass Storage Demo Problems

mattgczapar
Associate
Posted on September 20, 2011 at 21:51

Hi,

I am working with the STM3210C-EVAL Board and the demos provided with the 

STM32F105/7 and STM32F2xx USB on-the-go Host and device library.

The libraries provided for initializing the USB on the device take a structure that is a set of callbacks that the user creates for the various usb events.  In the demo, they are all contained in the files usbd_usr.h and usbd_usr.c.  

These files almost exclusively deal with the LEDs and the LCD screen for the demo.  I am working on taking the demo from one board to another that doesn't have an LCD screen.  As I understand the goal and function of these files, none of the core USB functionality should be affected by modifications to this file.

When I take out the LCD initialization (as well as all calls to the LCD that would depend on this initialization) my demo never successfully connects to the host PC.  It will show up as a device, but it is not possible to read or write anything to the device.  

Pausing the debugger does not indicate that any fault is occuring.  

Further, I have a USB protocol analyzer and an inspection of the packets sent back and forth reveal that the USB device will read the first sector of data, and then fail when subsequent sectors are attempted to be read from the USB device.  

I've checked, and the SPI lines that goes to the memory card appear to behave appropriately on a scope.  Also, the first sector that returns is the same first sector byte for byte as when the demo functions with the LCD portion of the code in it.

Unless I am way off, I assumed the usbd_usr functions could all be replaced with empty functions, and nothing should be affected as far as the core functionality goes.    

Anybody have any thoughts about what might be going on here?  

#usb-msc #usb-msc-mass-storage #usb #mass-storage
4 REPLIES 4
jlchoobs
Associate II
Posted on April 24, 2012 at 19:41

I have the same problem.

I did the same procedure; I commented out the LCD routines - including Init Lcd.

-> The USB connects - but the Windows reports 'Mass Storage can not start'.

Hardware is connected correctly - I tested alternate code for Usb MSC with SCard.

I am working on Porting over the Stm3240g Board Firmware to the Stm32f4Discovery Board. The Boards both use the same chip stm32f407 - just different pinouts. Obviously there are compatibility issues on the Port connections.

* Currently I have BlinkLed working with PC.7 and PE.0 ports.

* I have successfully connected itvia USBas Mass Storage - Windows recognizes the USB Mass Storage -

BUT itreports as 'Mass Storage fails to start'. I am using an SDCard connected -like the stm3240g board except that SD_DETECT is switched from PH13 to PH0. The System_stm324xx_eval.h has PLL_M=25 to PLL_M=8 for Clock whichis needed forthe USB connection.

I do not know why the SDCard fails - the Card is tested as working.

see:

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Using%20Stm3240g%20firmware%20on%20the%20Stm32f4Discovery%20Board

jlchoobs
Associate II
Posted on April 25, 2012 at 09:15

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
Associate II
Posted on June 16, 2012 at 16:20

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.

Posted on June 16, 2012 at 19:17

You've replied to the same post in three threads. One would have sufficed.

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