So to get rid of these interrupts I've tried to monitor the presence of power on UsbVcc of my board and stop the driver on usb power loss by a call to
Code: Select all
sduStop(&SDU1));but hit the following assertion:
Code: Select all
usb.c:292
chDbgAssert((usbp->state == USB_STOP) || (usbp->state == USB_READY),
"usbStop(), #1", "invalid state");
The value of usbp->state at that moment was USB_ACTIVE.
Before calling sduStop() I waited for suspend event from driver to get sure there's no activity present on the bus.
I'm using the ChibiOS version 2.4.3.
Is this a bug in usb driver? If not then how am I supposed to stop the driver?