cancel
Showing results for 
Search instead for 
Did you mean: 

USB MSC device low transfer rate - STM32F7

charles239955
Associate II
Posted on May 18, 2016 at 16:19

Hi All,

I am using the latest STM32 Cube distro with an STM32F7x DISCOVERY board for hardware (class 10 uSD card in the slot) and IAR Kickstart development environment.

The USB MSC Device project (high speed port through ULPI) works/builds well. However... the file transfer rate (writing from PC to the device) is very low (~350kBps).

Debugging the code showed that on line 351 of usbd_conf.c, DMA is disabled for the USB HS port. I enabled DMA at this point (changed the 0 to a 1) but there is still no improvement.

There are a couple of other posts on this subject already (

https://my.st.com//public/STe2ecommunities/mcu/Lists/STM32Java/USB%20MSC%20low%20transfer%20speed

 and 

https://my.st.com//public/STe2ecommunities/mcu/Lists/STM32Java/Slow%20transfer%20rate%20USB-HS%20MSC

) but no advice available.

Am I missing something obvious? I am expecting too much performance from the hardware?

Thanks in advance.

#device #usb #msc
11 REPLIES 11
Posted on January 20, 2017 at 07:23

Do you, or anyone,  have an example project that can achieve 125 Mbs on the stm32 F7 Discovery?  I have a MSC device just writing to sdram as a 16MB fat file system and only achieve around 50-60 mbs.  I am going to change the packet sizes as described above to see how much that influences the xfer rate.

Thank You in advance

vaidasmikalajunas
Associate II
Posted on March 13, 2017 at 14:59

Hello, 

does anyone reached more than 4-5MB/s transfer rate with stm32cube generated code? Raw data reaches 15-20MB/s, but MSC looks very poor - with MSC_MEDIA_PACKET 32768 I can get only 4-5MB/s. Also there are more interesting things with code optimizations.... 4-5MB/s speed is maximum with O3 optimization, but using O3 optimization - USB dma could not be enabled (earlier CubeFW version worked normally). Also there very interesting things with magic numbers, like 0x174 (HAL_PCDEx_SetTxFiFo(&hpcd, 1, 0x174), which does not work stable with raw data and dma_enable = 1 ...

Now I'm wondering - can ST make tested examples, which works normally with all options...

Thank You.