2019-04-08 06:58 AM
Hi,
We are using STMCubeMX to generate the code for USB-Device Mass Storage class for STM32L4R5 controller.
We have to check the usb connect/disconnect status run time.
Try to use HAL_PCD_ConnectCallback/HAL_PCD_DisconnectCallback function but never get call back here.
Please suggest how to use these call back function or any other method to check the USB status?
Thank you.
2019-04-08 07:20 AM
Evaluate (hUsbDevicexx.dev_state==USBD_STATE_CONFIGURED) if zero or not zero
hUsbDevicexx is the USBD_HandleTypeDef handle of the device.