I found an issue in OTGv1 usb_lld.c: in case when CORTEX_SIMPLIFIED_PRIORITY = TRUE a special assumption that OTG FIFO operations must not be interrupted is not satisfied.
New code:
Code: Select all
#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE)
#if (STM32_USB_OTGFIFO_FILL_BASEPRI > 0)
__set_BASEPRI(CORTEX_PRIO_MASK(STM32_USB_OTGFIFO_FILL_BASEPRI));
#endif
#else
__disable_irq();
#endif
...
#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE)
#if (STM32_USB_OTGFIFO_FILL_BASEPRI > 0)
__set_BASEPRI(0);
#endif
#else
__enable_irq();
#endif
Patch attached.