Add additional condition to msc state assert
Assert that bulk out is halted when handling an unexpected out packet
when waiting to send the CSW. If this endpoint is halted then the
packet is leftover from the previous transaction.
@@ -1077,8 +1077,13 @@ void USBD_MSC_BulkOut(void)
case MSC_BS_CSW:
// Previous transfer must be complete
- // before the next transfer begins
- util_assert(0);
+ // before the next transfer begins.
+ //
+ // If bulk out is stalled then just
+ // drop this packet and don't assert.
+ // This packet was left over from before
+ // the transfer aborted with a stall.
+ util_assert(USBD_EndPointHalt & (1 << usbd_msc_ep_bulkout));
break;
case MSC_BS_RESET:
