2012-03-27 06:23 AM
Hi,
I'm using the USB-Host (MSC class) library to read/write USB flash drives with STM32F105/107. I've the STM3210C-EVAL board to try the example bundled in the official package (compiled with MDK-ARM, but also with bare-bone Codesourcery GCC -> same results). USB Host MSC example -> used with 3 different USB flash drives Lexar JDFF4GB-00-5015 VID: 05DCh PID: A781h Manufacturer : Lexar Product: JD FireFly Transcend JF V30/2GB VID: 058Fh PID: 6387h Manufacturer : JetFlash Product: Mass Storage Device Transcend TS128MJF2A VID: 0C76h PID: 0005h Manufacturer : JetFlash Product: TS128MJF2A All USB drives enumerate, butonly
in the Lexar one the f_mount / Explore_Disk demo execute successfully, in other two devices the functionshangs
. I've tried ''STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0'' too, same target, same compilers (MDK-ARM and bare-bone Codesourcery GCC). With that library I've got better results, only the Transcend TS128MJF2A device hangs. Seems that LibraryV2.0.0 works better with STM32F105/107 target. Best Regards, Luca #usb-host #usb-msc-mass-storage #usb-device-msc-code-sourcery #stm32-usb-library #usb-host2012-03-27 06:19 PM
What is the file format on other 2 usb disks which do not mount ? The Host library uses free file system for FAT16/FAT32. Maybe you formatted the other 2 disks on a diferent file system causing the File system to get confused and Hang.
Can you re-format these 2 usb disks on WIN-XP or other OS and then try to mount the drives on host lib ? i am using host lib, didnt face problem with several usb disks.2012-03-28 01:34 AM
Hi alokm,
all pendrives are formatted with FAT (16/32) filesystem. Reformatted the Transcend TS128MJF2A one (this device doesn't work either in library 2.0.0 or 2.1.0) , but with no success .... One curious thing I noticed : if I plugfirst
the Lexar device, let the demo firmwareonly
enumerate it, then unplug Lexar and connect the Transcend TS128MJF2A device, it works ! (both mount and file explorer) Resetting board, plug Transcend TS128MJF2A, enumerate OK, mount/file explore fails. This is really odd ...2012-03-28 10:25 AM
TS128MJF2A means 128 MB ?
Just a seemingly stupid question. WHich is the OS on PC which you used for formatting the USB Disks ? Is it by change Win7 ? Do you have Win-XP ? Is it possible to format with another PC and Try ? (it may sound stupid since FAT16/32 is shown....but worth a try) Do you have by chance USB analyser to capture the transactions between STM32 and usb disk ? When Lexar disk is removed, is it detected by stm32 ?2012-03-29 12:47 AM
first
Lexar and then TS128MJF2A) without resetting the STM32 it works too.2012-05-24 12:27 PM
STM32_USB-Host-Device_Lib_V2.1.0 (MSC issues) - with Code Sourcery
Luca, I have been using the Stm32 Host Device Lib V2.1.0 MSC with the STM32 with no problems with the Usb FlashDrives. I have been compiling using Atollic. I tried compiling it using the Code Sourcery - but I dont think I loaded the above Project correctly. What setup did you use for the Code Sourcery - none of the directories specify Code Sourcery? (so I used the Atollic dir/project) But when I build - it just says 'nothing to compile'. I can compile other STM32 Projects on the Code Sourcery though - so Code Sourcery is setup right. I just cant configure the Stm32 Host Device Lib V2.1.0 MSC Project. How did you load/configure it on Code Sourcery ?2012-06-18 08:08 AM
Hey jlsilicon,
sorry for this reply delay, check the file in attachment. It is my GCC/CodeSourcery workspace directory (used with barebone compiler and makefile). Just modify the makefile with your paths. I hope that helps ! Regards, Luca ________________ Attachments : STM3210C_EvalGCC_USBMSC.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtWw&d=%2Fa%2F0X0000000aRL%2FWUPRFrjJS7heeWFLrpvnbcj7pIEvBGlnygZ2wdkNpBc&asPdf=false2012-06-19 12:15 AM
try changing in usbh_conf.h
#define USBH_MAX_NUM_ENDPOINTS 2 to #define USBH_MAX_NUM_ENDPOINTS 3I hope it is
useful
Paolo2012-07-26 01:10 AM
Dear Paolo,
I'm back to my USB-Host activity (after a month in another project)...Your advice was very helpful, now all my USB pendrives seem to work correctly ! Thank you, Luca