Question
How to recognize USB ready
I'm trying to transfer data to the upper computer using virtual port com on STM32G473RET6.

But how to recognize USB ready before transfering data?
if (USBD_STATE_CONFIGURED == hUsbDeviceFS.dev_state)
{
CDC_Transmit_FS(UserTxBufferFS, payload_len);
}The above code is not rigorous,if (USBD_STATE_CONFIGURED == hUsbDeviceFS.dev_state)Through this code, just knowing that USB has already been initialized.But stm32 MCU doesn't know whether the upper computer has opened the serial port.
How to know the upper computer has opened the serial port?
Thanks for the help!
