What is the means to reset just the internal USB OTG PHY of the STM32?
Hi,
I noticed that there are debug messages advising to disconnect the device from the USB port.
- But it has happened to me that the USB port remains stuck even after removing the device (keyboard) and reconnecting. I had to reset the MCU in this case.
- It has also happened that the USB device does not respond after resetting the STM32F407VGT6.
I've tried de-initializing and initializing the USBH via the HALL functions, and it seems to have helped to get it working again, but it didn't completely resolve it. Completely resetting the STM32 using the "NVIC_SystemReset()" command re-established communication most of the time.
- Apparently the USB device is reset when the STM32 is reprogrammed via STlink. I noticed this because I added keyboard LED activation routines, and the LEDs go off when reprogramming the STM32, in this case I didn't use power manager, the keyboard was always powered with 5V, so it wasn't a power reset.
- (When I did the keyboard reset test via Linux PC, using usbreset cmd line, the keyboard LEDs didn't go out)
- Perhaps as a starting point for researching what happens to the device when the STM32 is reprogrammed via STlink, I will try to monitor the USB port data lines with logic analyzer.
I thought of programmatically resetting the value of all CSR registers (Core global control and status registers - Ref.: RM0090). Could this work as a reset of the OTG PHY module?
- What would be the way to accomplish this, would you have to de-initialize PHY, stop the PHY clock, and then change the CSR registers?

