cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I-DISCO USB MSC trouble

prohorov_leonid
Associate II
Posted on July 14, 2015 at 13:12

 Hello. I am trying to make USB MSC device on this board with internal RAM disc as storage.

 I am using STM32_USB-Host-Device_Lib_V2.1.0 and i use USB MSC project from that archive as example.

 I have made changes in three files:

  • usb_bsp.c (left only Pin and Interrupt configuring),
  • usbd_storage_msd.c (changed to read/write from 64 Kb array in the internal RAM)
  • usbd_usr.c (removed all board dependent code).
 Now my OS (Windows XP) recognizes the device and asssigns letter to in. But when i try to do something with the disk (even try to open popup menu) my explorer hangs.

 When i see with USB Sniffer (USBTrace) i can see many strange transactions on the bus.

 For example in line 423 (on the attached image) i see BULK OUT transaction to the 81 endpoint, but this endpoint type is IN.

 How can it be? And host makes RESET_PORT regularly after such transactions.

Sorry for my english please.
3 REPLIES 3
Posted on July 14, 2015 at 15:42

I have posted an MSC SDRAM-DISK example for the STM32F429I-DISCO

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
prohorov_leonid
Associate II
Posted on July 15, 2015 at 07:49

Yes, i found it, but only .hex file. i have programmed it into board MCU and it works. But it doesn't help me.

 And today i have made some changes. now i am using external SDRAM on the board and i use it as RAM disk. but my problem remains. i found one decision.

 i am changed MSC_BOT_Init function by adding such lines:

  DCD_EP_ClrStall(pdev, MSC_OUT_EP);

 

  DCD_EP_ClrStall(pdev, MSC_IN_EP);

 

 Now sometimes i can format my disk. But work remains unstable.

prohorov_leonid
Associate II
Posted on July 15, 2015 at 08:43

oh, i'm so sorry. i found the bug. when i learned how to use this library i added debug information output in usbd_core.c file. and i attemted to write out of debug information array index. now it works fine.