cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f7 USB MSC class problem in HS mode (Solved, IAR optimization bug with USB lib)

mengsk8086
Associate II
Posted on February 14, 2016 at 16:01

Hi,

I tested the official USBD MSC exemple with a stm32f746-disco board in HS mode, and I got a very bad speed. For several high speed sd card, I got write:400KB/s, read: 1.6MB/s.

Then I tried to increase the MSC_MEDIA_PACKET, then the board showed as unknown device, which works in FS mode (for a  buffer of 16384 I got write:700KB/s).

Is this a bug MSC_MEDIA_PACKET with HS mode ?

#sdio #msc #usb
4 REPLIES 4
Posted on February 14, 2016 at 16:28

Would suggest you quantify the speed of the SDIO implementation outside of the USB/MSC, so you can determine exactly where the drag on bandwidth is coming from.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mengsk8086
Associate II
Posted on February 14, 2016 at 17:35

Now the problem is as I cant change 

MSC_MEDIA_PACKET(or USB is bugged in HS mode), sdio write only 512 bytes each time, so it can't benifit from Multi Block write command, in consequence the write speed is even lower then in FS mode.

mengsk8086
Associate II
Posted on February 14, 2016 at 20:37

Problem solved ! There is a bug with the IAR compiler, when optimization set to High-Speed,

the USB device not work.

Now with a buffer of 0x4000, I got 8MB/s in read and write.

Posted on December 10, 2016 at 08:24

I'm having problem with USB CDC driver when compiled with GCC -Os.  Did you identify the function or the file that had the optimization issue?   I've used highest level optimization with Atmel (SAM4) and never had a problem... STM code... no such luck.