cancel
Showing results for 
Search instead for 
Did you mean: 

A general USB question

mmensch
Associate II
Posted on June 28, 2016 at 10:13

Hello,

when using a UART I can feed the Tx buffer on my STM32 without caring if someone listens on the other side eg a PC. In any case the uC side will work the same way.

How is this with a USB device, CDC VCP stack, esp STs CubeMX solution? The device might not be enumerated ie not connected to a host at all or on the PC side the COM port is not open. Does anybody know, how this will affect software flow on the uC side? As much as I see here the interrupt (USB_LP_IRQHandler) is not triggered any more. How can I determine in my uC application that data will really be sent ie the device is enumerated and a COM port is open?

Thanks a lot

Martin

2 REPLIES 2
Walid FTITI_O
Senior II
Posted on June 29, 2016 at 12:57

Hi Mr_M_from_G,

You can achieve that by enabling and using the USART receive interrupt. Please indicate which device are you using and why you mention the LP IRQhandler ?

-Hannibal-

mmensch
Associate II
Posted on June 29, 2016 at 16:41

Hello Hannibal,

maybe I did not explain my question clear enough.

My software for STM32 uses ST CDC VCP stack. Now I want to be sure, before loading data into the TX buffer that they will really be send over the VCP. As much as I understand USB (and that is not down to details) this only happens when the USB device is enumarated to a host and (maybe) also there is a COM port on the PC side open and attached to this VCP device that is my STM32. Maybe I am completely wrong, but so far I found it this way.

Now my question is, is there some kind of status byte or so telling me about that, telling me if the device is enumerated and attached to a COM port number.

I hope it is clearer now

Martin