Windows 7 Startup Freezing with USB Flash Drive and SD Connected

Hello,

I get this problem when loading Windows 7 with UEFI and secure boot. When disconnecting all USB devices, it just works fine. The OS says that I have working USB 3.0 drivers and it just works fine inside the OS. I installed an ESU update which added support for secure boot, one of the latest updates of Windows 7. I want to fix this without always removing my USB devices temporarily. Any way? It is always stuck at CLASSPNP.SYS when I try in safe mode. I am using an UEFI class 2 system.

EDIT: It happens only with my USB flash drive, not at my USB mouse. Weird

On Asus prime b450. Disabling BSOF and enabling precision boost overdrive fixed it

I have a Lenovo Ideapad where this was happening. I however removed Windows 7, but possibly I may do more tests in the future.

Yes, it happens randomly. For me, 2/3 reboots and all good.