cancel
Showing results for 
Search instead for 
Did you mean: 

How to I disable the USB on the STM32L4

SSmit.13
Senior

Hi

 I am using the USB CDC on a STM32L433 with the command MX_USB_DEVICE_Init(); to communicate through the USB. In my app, I go into standby mode (by using the HAL_PWR_EnterSTANDBYMode()) command. How do I disable the USB before entering standby?  I tried the the command USBD_DeInit(&hUsbDeviceFS) , but got a hardware fault. Anyone let me know the best way to disable it?

 

Best Regards

Scott

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @SSmit.13 

I suggest you set the USBFSRST High then Low to reset the USB FS and set the USBFSEN Low to disable the USB FS clock.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
STTwo-32
ST Employee

Hello @SSmit.13 

I suggest you set the USBFSRST High then Low to reset the USB FS and set the USBFSEN Low to disable the USB FS clock.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

That worked, many thanks

 

Scott