cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get 20MBytes/sec over the HS USB on the STM32F4 ?

Spaced Cowboy
Associate III
Posted on August 24, 2013 at 06:37

I'm trying to interface an old computer with a VME interface which can (and does) produce a burst-y 20MBytes/sec throughput. There's a CPLD to decode the VME timings, and I'm intending to use the USB as bulk-data transfer (99.9% of the traffic), and use a SPI port for low-latency, low-volume replies back to the VME system.

Since I'm using a CPLD, there's no buffering on the VME interface, so I want something that can trigger on a signal going low and read 16-bits of data, then itself set a signal low, lather, rinse, repeat (about 20 million times/sec :) The VME bus runs at ~10MHz (not really, it's an asynchronous bus), but throughput is about 20 MBytes/sec with a 16-bit databus. I think the GPIO's of the STM32F4xxx should handle that easily.

My concern is more the other end, I've just been burnt *cough*FTDI*cough* by a chip that advertised 40MBytes/sec but only achieves that on Linux kernels that were minted in 2008... Modern kernels apparently top out at ~9MBytes/sec under Linux, and the software is closed, so I can't fix it.

So, what's the throughput I could expect from the STM32F4xxx chips ? I understand it'll vary with transfer packet size, but all I want to do is open a bulk transport stream from the STM32 through to a Linux box and write data as fast as possible. For the sake of argument, let's say I write in 512-byte chunks or 32kB chunks. There'll be some small (16-32 byte) chunks but those will be rare.

Any help with this gratefully received :)

Simon

#stm32f4
4 REPLIES 4
jpnorair
Associate II
Posted on August 26, 2013 at 08:27

I've never tried to go that high, but you should be able to get there by using the DMA to move data from USB to GPIO.

dthedens23
Associate II
Posted on August 26, 2013 at 17:48

I'm a little more pessimistic.

To get that kind of speed out of Linux you might need a special driver that can handle a fat EHCI pipeline.  No other crap, not even a mouse or keyboard, on the USB bus.

The F4 has a 4K USB FIFO per endpoint and BULK transfers are 512 bytes per packet.

BULK is the fastest transfer by far.

If you user more than one endpoint, and you might have to to get the speed, then you might have to worry about reconstructing the data because of out of order concerns.

We are talking about a nice I7 2600K or better Linux box running USB Host right?

root
Associate II
Posted on August 27, 2013 at 01:14

Hello,

Saleae Logic uses a cypress FX2LP EZ-USB chip and is able to throw up to 24Mbyte/sec on the bus using pass through firmware on Windows, Linux and Mac.

I guess I'd use this chip if I had to get that bandwidth (now that I know the FTDI chip can't do it ...).

Thomas.
Spaced Cowboy
Associate III
Posted on August 27, 2013 at 17:52

Thanks all,

Linux doesn't have a problem with high USB bandwidth in general - there are plenty of reports of people running >30MBytes/sec over USB. I'd looked at the cypress part, but it's $20-ish in small quantity, and I was hoping to keep costs down. There are good reports of the PLX NET2272 which is ~$10, but that's still twice the price of the FTDI chips... Of course, the PLX ones actually deliver...

I've ordered a dev-board for the STM32F4 so I think I'll see what I can get it to deliver over USB, and if not it's a pretty easy change to tack on the USB chip to handle the load.

Cheers

  Simon.

[Edit: for those who may be searching for this later, a colleague of mine has told me he can sustain 37 MBytes/sec over USB using the STM32F4 when sending from a RAM-based buffer]