How do I reset the internal USB state machine correctly when something USB-related goes wrong?
I'm working with the Nucleo-64 development board with an STM32L476 microcontroller and I'm using the USB source code that STM32CubeMX has generated for me. Every once in a while something unpredictable happens, e.g. the user unplugs the USB-cable in ...