Skip to main content
Bhushan
Associate
April 8, 2019
Question

How to check the USB connect/disconnect run time?

  • April 8, 2019
  • 1 reply
  • 719 views

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.

This topic has been closed for replies.

1 reply

Vangelis Fortounas
Associate II
April 8, 2019

Evaluate (hUsbDevicexx.dev_state==USBD_STATE_CONFIGURED) if zero or not zero

hUsbDevicexx is the USBD_HandleTypeDef handle of the device.