cancel
Showing results for 
Search instead for 
Did you mean: 

COM over USB sending unexpected packages

bernhard239955_st
Associate II
Posted on June 28, 2011 at 16:48

Hello everybody,

I'm using STM32F103ZEH6. The device is connected to a host pc via USB emulating a virtual COM port.

From time to time I can detect 2 similar packages with my USB-Sniffer an the host pc recognizes them, too. But I do send this package only once!

Does anybody have an idea why this is happening?

It seems not to be a problem with USB protocol. The USB-Sniffer does not detect any errors.

Thanks for your help!

bgl

#usb-com #virtual-com-port
8 REPLIES 8
rosarium
Associate II
Posted on July 05, 2011 at 09:26

Can you provide the USB trace??

bernhard239955_st
Associate II
Posted on July 05, 2011 at 17:09

Hi Pila,

I attached an excerpt of the trace.

Lines starting with ''//'' provide comments from myself.

bgl

________________

Attachments :

UsbBug.pkt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Jv&d=%2Fa%2F0X0000000blI%2FR2TwiI99wExRJaVG4KApQDR09TSxvmeXZKGnu8KpM_o&asPdf=false
rosarium
Associate II
Posted on July 06, 2011 at 10:01

so which data pkt you are talking abt???  ''69 81 58'' ???

bernhard239955_st
Associate II
Posted on July 06, 2011 at 10:20

I'm talking about the lines 78 to 92. There You can see that two identical Data packages are sent to the host. They differ only in DATA0/DATA1 identifier.

I'm transfering these data to the endpoint buffer only once.

rosarium
Associate II
Posted on July 06, 2011 at 11:30

Plz check if the state machine is updated properly.

I mean after sending data for the first time is the state updated??

alok472
Associate II
Posted on July 07, 2011 at 14:58

Are you using the Virtual Comm port example provided in USB-Library ? or You have developed your own firmware ?

bernhard239955_st
Associate II
Posted on July 07, 2011 at 18:19

Hi!

Thanks Pila for pointing me to the right direction. Although the states were updated correctly I could detect a race condition between the write counter and the IRQ. This error must have been built in while customizing the source code.

I checked the virtual com port example and think it is correct.

Thanks for Your Help!

bgl

rosarium
Associate II
Posted on July 08, 2011 at 10:40

thats good..