cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in USB CDC Class Init/Deinit

frackers
Senior
Posted on June 26, 2017 at 04:04

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

2 REPLIES 2
frackers
Senior
Posted on June 26, 2017 at 06:17

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!

Posted on June 28, 2017 at 12:12

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen