2017-06-25 07:04 PM
I plug in my CubeMX generated USB CDC class implementation into a PC host and CDC_Init_FS gets called as expected
When I unplug, I expect that CDC_DeInit_FS be called so I can take the link down but it doesn't.
When I plug in for a second time, CDC_DeInit_FS DOES get called and the CDC device fails to enumerate on the host. Again, when I unplug, no Init or DeInit calls.
All other aspects (transmit and receive of data) operate correctly, its just that my device needs to know if its connected and at present I can't get that information.
I'm using CubeMX 4.21.0 and HAL STM32Cube FW_F3 V1.8.0
2017-06-25 09:17 PM
Can someone confirm that the connect/disconnect callbacks are only implemented on the OTG block used by the F4 series as I can't find anywhere on the F3 where HAL_PCD_ConnectCallback & HAL_PCD_DisconnectCallback are hooked.
If that is the case I'm buggered!
2017-06-28 05:12 AM
Hi
Gilks.Robin
,Please note that Connect and Disconnect
PCD
callback are not used in PCD IRQ handler is not an issue.This is because there is no ISRs to manage connection and disconnection in the USB version available in F3 product (unlike F4 for example). For F3 products and others products which integrate the same USB version, you need to use a GPIO and monitor Vbus.
Regards
Imen