cancel
Showing results for 
Search instead for 
Did you mean: 

USB Data Transfer at High Speed

pedro2
Associate II
Posted on August 11, 2015 at 12:28

Good afternoon to everyone!

I want to develop a system around the stm32f4discovery hardware (I own this board) that acquires data from peripherals (one IMU, GPS and internal ADC) and ships it through USB to a HOST PC that does some calculations to get the attitude and position of an RC Plane. 

Now, I've read about USB classes and I guess that what I want is the USB CDC class, but a question arises:

- Some people say that this is like a virtual com port, where the baudrate does not interfere with speed: is this true?

- If so, what is the maximum theoretical speed, considering I am using the OTG_HS_x ports?

- For the architecture I am looking for, is this the best solution?

Thank you in advance!

Pedro,
7 REPLIES 7
pedro2
Associate II
Posted on August 11, 2015 at 17:45

UP

Posted on August 11, 2015 at 18:10

Bumping a thread after a couple of hours is pretty lame, can we please stop doing that?

Without a PHY you're perhaps looking at 600-800 KBps for certain USB classes.

On the off chance you're not putting the PC/Laptop in the RC plane, where is all the data going? If you're recording it to an SD Card, maybe an USB MSC would be a better solution, which you can read the files off after the plane hits the ground?

A VCP that's just pushing data back and forth, the baud rate doesn't have to have any meaning, the PC side my pace itself based on expectations of data throughput.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pedro2
Associate II
Posted on August 11, 2015 at 18:28

Hello Clive!

At first, let me apologize you for the Bump, I am used to european data (11/8/2015) and saw (8/11) and thought that I had put this on that day. Lot's of working going around, got lost. I am deeply sorry for that, as I myself find it really annying!

I want to put a linux computer on the RC Plane for some investigation and control midflight, that's why I have chosen CDC.

I suppose that a Host PC has a PHY, or does it not? 

Moreover, does the stm32f4 support 12Mbps speed using the OTG_HS_X ports?

Thank you very much in advance, and again, sorry for that bump,

Pedro

Posted on August 11, 2015 at 19:54

The F4 needs an External PHY for ''High Speed'', the Internal PHY will support ''Full Speed'' 12 Mbps. USB uses half-duplex. Where the data is somewhat asymmetrical 600-800 KBps is possible. I would expect, based on feedback, the VCP speed is somewhat lackluster. How fast it goes might depend on your comfort level playing with USB peripherals and Linux side driver code.

The F4-DISCO has it's USB connected to the FS port, the F429I-DISCO it's on the HS port in FS mode.

If I were putting a Linux board on a plane, I might look at the Intel Galileo II and interface via serial using an Arduino shield.

ST's Nucleo and STM32F7-DISCO boards can take Arduino shields also, have one that does GPS.

There are also AHRS boards, some using STM32 micro's that might easily be interfaced with serial, or FTDI-USB type adapters to Linux boards. I think they have some dual serial ones.

https://www.openimpulse.com/blog/products-page/product-category/ahrs-stm32-10dof-imu-accelerometer-gyroscope-magnetometer-pressure/

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pedro2
Associate II
Posted on August 11, 2015 at 20:08

Thanks for the note Clive!

Well, sorry if the following are just noobish questions, but I am still a bit confused:

- Serial (UART) will have the speed limit of 115200 baudrate, right?

- If the USB on the STM32 supports 12Mbps, why can't I take advantage of this? Is it a protocol problem (CDC) and this speed can only be achieved in other modes (such as MSC)?

- Finally, thank you for the suggestions! This is intended to be a scalable system and I need other sensors for pressure, for instance one that can take a Pitot tube to get air speed, along with GPS and possibly GSM.

Posted on August 11, 2015 at 20:21

Where there's no RS232 level conversion issues I often run serial connections at 460800 or 921600. What's offered on the USB side will depend on the driver, and in the virtual realm may make no difference at all. It's only going to be speed limited if you have to stuff the data out of a physical USART that than just move buffers/blocks of data around.

12 Mbps (bits per second) might equate to 1 MBps (bytes per second). In my experience USB-FS can do in the order of 600-800 KBps, where the data's actually going somewhere. I don't deal a lot with VCP implementations, but I've run them on a couple of STM32 family parts. I haven't aggressively tested the STM32 VCP, but my sense, based on forum interactions, is that it's not stellar/ideal.

I would definitely expect 115200 baud (10 KBps) to be achievable. 1Mbaud, perhaps with some work.

I think you need to build some VCP examples for your board, and quantify how well they perform for you.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pedro2
Associate II
Posted on August 11, 2015 at 20:41

Thank you very much Sir, you truly helped me!

May I ask you some questions, not related to the topic of this thread (more on RTOS topic) by PM, just to get some suggestions?