Hello,
I am trying to detect when a USB is disconnected from my custom board using an imxRT1050. I have seen other forum posts that mention to use the USB_DEVICE_CONFIG_DETACH_ENABLE flag in the USB device config (https://community.nxp.com/t5/i-MX-RT/What-is-the-best-way-to-detect-attaching-and-detaching-of-an-us...).
Looking at the USB_1OTGSC register it does show that the BSVIE (B Session Valid Interrupt Enable) has been set, however the interrupt doesn't seem to trigger. I know this as I will get interrupts when I plug the USB in, but not get one when I pull it out.
The only way I've managed to detect it is by polling the SUSP (Suspend) bit within the USB_1PORTSC1 register the tells me whether or not the connection is suspended. I should be able to get this to work. but I would rather use the dedicated disconnection interrupt as it doesn't involve polling the register.
Any ideas as to why the B Session End Interrupt may not be triggering?
Thanks,
Nick