cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 USB Speed, Fifo size

elgerta
Associate II
Posted on December 14, 2011 at 20:52

Dear all,

I've not found a related topic.

Right now I've checked with the demo of mass storage device the possible maximum transfer speed.

And it looks like ~500kByte/s, for writing to the device.

The define at usb_conf.h shows a RX_FIFO_SIZE of 128.

I thought I can increase the transfer speed by increase the RX_FIFO_SIZE, but with a value of e.g. 256, the USB init fails at while (bDeviceState != CONFIGURED);

So, is there a mistake from my side? Or to change other parts of the code to increase the transfer speed.

Target will be the value of ~1MByte/s.

Regards

Achim
2 REPLIES 2
rosarium
Associate II
Posted on December 15, 2011 at 06:41

By only changing the fifo size is not enough.

You have to look into the state machine of BOT.

Do you capture any USB trace of your problem.

elgerta
Associate II
Posted on December 18, 2011 at 20:27

I've forgotten that I use the demo from STM32_USB-FS-Device-Lib_3.3.0.

After your comment, I've look at the different functions from EP2_OUT_Callback(), Mass_Storage_Out(), USB_SIL_Read() and so on up to Write_Memory().

And at the end, Write_Memory() has a loop to add 8 times 64 bytes and then call MAL_Write().

So, it looks like that everthing transfer only 64 bytes.

I've measured the time for each function call of Write_Memory() but without writing to the mass storage.

Each 64 bytes, or each function call takes approx. 150µs.

8 functions calls with 64bytes takes approx. 1ms, which results in approx. 512kbytes/s.

Means I can't take every package during the 1ms frame.

If I'm right, fullspeed has 1ms frame time and max. 19 packets, and ~53µs for each packet?

But how many time between each packet?

If you mean a software like USB-Trace, right now no.

Has someone more experience with the STM32F105 and increased FIFO size together with BOT?

Is it possible to reach a transfe speed of ~800..900KBytes/s?

Regards

Achim