2016-06-28 01:13 AM
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 Martin2016-06-29 03:57 AM
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-2016-06-29 07:41 AM
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