STM32L452 USB CID problem when I unplug and again plug in the USB connector
Hello all,
When I run the code, it works as expected, but when I unplug and then plug-in again, the system halts and when I debug it, it is like the USB_IRQHandler() is being called in succession very fast as if the IRQ pending bit is not reset. The value if the USB->ISTR register is seen 0 and NVIC->ICPR[USB_IRQn] is also seen 0. I can't figure out who is triggering the USB and why the pending bit is not reset after the interrupt handling.
I appreciate any help from you
I am using stm32CubeMX auto generated code for Keil using USB Middleware
I have attached the setting of the StmCubeMX project

