From 4140b3b9443c47b8eda05de60b312b7df65ff5e0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Nov 2017 15:07:41 -0700 Subject: [PATCH] atmel-samd: Stop double CSW after MSC reads This explicit zero length xfer leads to a second CSW packet. If another read was started between the two CSWs then the host gets confused and resets the device. On reads, the CSW is automatically sent when we reply with the total length. Writes must do it manually so they can wait for the disk to flush the data. --- ports/atmel-samd/usb_mass_storage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/usb_mass_storage.c b/ports/atmel-samd/usb_mass_storage.c index c8301228cd..8001cc097a 100644 --- a/ports/atmel-samd/usb_mass_storage.c +++ b/ports/atmel-samd/usb_mass_storage.c @@ -273,7 +273,6 @@ int32_t usb_msc_xfer_done(uint8_t lun) { void usb_msc_background(void) { if (active_read && !usb_busy) { if (active_nblocks == 0) { - mscdf_xfer_blocks(false, NULL, 0); active_read = false; return; }