Which function can detect STM32F413 USB(CDC) connected or disconnected
Hello,
I use STM32F413ZG MCU and STM32CubeMx to create the Keil project.
Now, I need USB as communication Device Class(Virtual Port Com) to transmit data to computer(Master). But I do not know which function in USB library can detect USB cable plugged in the computer or unplugged in? I tried to set up breakpoints in
function USBD_LL_DevConnected(USBD_HandleTypeDef *pdev)
and USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev) in USB_core.c.but program never went to here when I plugging in USB or taking USB out.
Note, the computer can find USB in and get the serial port (COM6) and I can sending and receiving data via USB port (COM6).
Do you know the function or a interrupt can detect USB connection or disconnection?
Thanks a lot.
June
#how-to-detect-stm32-usb-cdc-connection-or-disconnection