cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging USB

nico2
Associate II
Posted on July 27, 2009 at 06:42

Debugging USB

5 REPLIES 5
nico2
Associate II
Posted on May 17, 2011 at 13:18

Hi all i use KEIL and device STM32F103T8

I want to know how to debug USB?

The code that I implemented in my code is the virtual com port code example.

This works beautifully but want to change the code to receive more than a single byte at a time and buffer this ?

Any suggestions ? DMA ?

psd
Associate II
Posted on May 17, 2011 at 13:18

Nico,

I think if you use more than 1 byte at a time, you will no longer have a communication class device, and you will have to use a custom USB driver on the PC side of things. If you don't have one you can use the libusb-win32 open source driver (C code), or NI VISA's USB interface (LabVIEW code).

Phil

andreas2
Associate II
Posted on May 17, 2011 at 13:18

psd:

Not true, number of bytes per transfer is not fixed to one for CDC. That would be pretty useless.

nico1:

lanchon posted a vcom package here on the forum long ago with an improved virtual com port example. The ST code is rather flawed but seems to work often enough. As far as I recall lanchon's version had receive (but not transmit) buffering. By the way, I think ST's sample code has 64 bytes wMaxPacketSize so if the application on the host is providing data fast enough, you should already be getting more than one byte per transfer.

nico2
Associate II
Posted on May 17, 2011 at 13:18

🙂

Thank you guys for the reply.

I will try and find the enhanced Vcom example.

Any comment about debugging USB in keil?

st3
Associate II
Posted on May 17, 2011 at 13:18

Quote:

Any comment about debugging USB in keil?

As far as Keil is concerned , it's all just software: it neither knows nor cares what that software is intended to do - whether it's USB, async serial, or anything else.

If you (think you) have specific USB issues, then you probably need some specific USB test gear; eg,

http://www.totalphase.com/products/beagle_usb480/