High-Speed Data Streaming over USB0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

High-Speed Data Streaming over USB0

2,118 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by joohyun.seo on Mon Sep 01 15:03:27 MST 2014
Hi All,

I am trying to dump data from LPC4337 microcontroller to PC with up to 10 Mbit/s of data rate.

Initially, I have dealt with VCOM example provided in LPCopen_2_12, but LPC VCOM Port Driver from the window size can accomodate Baudrate only up to about 120kbps. From PC side, I have used the MATLAB serial port to receive data and communicate with the MCU.

My first question is if there is any LPC VCOM driver which can go close to 10Mbit/s range though I haven't seen any driver that can go up to that high data rate.

My second question is that 10 Mbit/s is achievable with virtual com port at all? If possible, what kind of setup should be done from the PC side?

My third question is that if 10Mbit/s is not achievable with virtual com port, how can I communicate with PC more than 10Mbit/s speed. I have looked into a hid_generic example, but I cannot figure out how to send data or receive data from USB port.

I am sure that someone should have done this kind of things before, and I only have limited knowledge about this matter. If someone can introduce any helpful reference or thread in this forum regarding this matter, it would be really appreciated.

Many thanks in advance.
Labels (1)
0 Kudos
Reply
5 Replies

1,784 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Benjamin Vernoux on Fri Dec 12 05:16:57 MST 2014
Hi,

I'm main developer of firmware for AirSpy (www.airspy.com) since lot of months (even year) on LPC4370 (and before on LPC4330 for HackRF)
and with a good computer you can reach in continuous 320Mbit/s (it is what we have with ADCHS@20MSPS running at same time) in HighSpeed USB 2.0 with Bulk Transfer (reached using M0 dedicated to USB HS), the source code of the firmware will be released as open source code in github in some month at same time the airspy board will be available.
Of course that extreme performance can be achieved only with code/data running from dedicated bank in SRAM  and with the help of dedicated driver (mainly USB2.0 HS & ADCHS...) which was written from scratch and integrated in libopencm3 (will be also available at same time as airspy board).

Best Regards
Benjamin
0 Kudos
Reply

1,784 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pierre on Wed Sep 17 02:15:24 MST 2014
Python and libusb1 example code will read from an endpoint :

import sys, os, usb1, libusb1, time, threading, fcntl, logging, json, Queue
logging.basicConfig(level=logging.DEBUG)

def open( vid, pid ):
    ctx = usb1.USBContext()
    for device in ctx.getDeviceList(skip_on_error=True):
        if device.getVendorID() == vid and device.getProductID() == pid:
            device = device
            break
    else:
        raise Exception( "ERROR: USB device %04x:%04x not found." % (vid, pid))
    
    logging.info( "Found device : ID %04x:%04x -> %s Address %d" % (device.getVendorID(), device.getProductID(), '->'.join(str(x) for x in ['Bus %03i' % (device.getBusNumber(), )] + device.getPortNumberList()), device.getDeviceAddress() ))
    
    handle = device.open()
    logging.info( "Device opened, got handle" )

    endpoint = 0x85
    length   = 65536
    timeout  = 100      # ms

    while True:
        data = handle.bulkRead ( endpoint, length, timeout )
        # do something with data


You need to setup correct descriptor for endpoint (maxpacketsize, etc). Device/Interface type can be vendor-specific so no useless driver is loaded.
0 Kudos
Reply

1,784 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by joohyun.seo on Wed Sep 03 11:00:10 MST 2014
Thank you all for your comments.

I haven't been able to find the Host driver which can go that high data rate when using CDC. So, I am playing with HID generic communication first. In terms of the host driver, I am referring to http://ahidlib.com/ to transmit and receive data. Thank you for giving me the good starting point.
0 Kudos
Reply

1,784 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Tue Sep 02 08:31:29 MST 2014
the bottleneck is often the Host driver when using CDC.  Especially Windows.
although HID might get you there, you may want to try a user defined class with bulk endpoints.
Many fast devices can get 30 M bit/s with libusb on a fast host, but I have not tried to benchmark the 43xx yet.
0 Kudos
Reply

1,784 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xianghuiwang on Mon Sep 01 18:56:28 MST 2014
Hi,
The generic HID example can give you the 10 Mbits/a transfer speed.
It is a good starting point.
Regards!
0 Kudos
Reply