We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a277db1 commit 95bb2a8Copy full SHA for 95bb2a8
drivers/source/usb/USBMSD.cpp
@@ -565,6 +565,14 @@ void USBMSD::_read_next()
565
566
void USBMSD::memoryWrite(uint8_t *buf, uint16_t size)
567
{
568
+ // Max sized packets are required to be sent until the transfer is complete
569
+ MBED_ASSERT(_block_size % MAX_PACKET == 0);
570
+ if ((size != MAX_PACKET) && (size != 0)) {
571
+ _stage = ERROR;
572
+ endpoint_stall(_bulk_out);
573
+ return;
574
+ }
575
+
576
if ((_addr + size) > _memory_size) {
577
size = _memory_size - _addr;
578
_stage = ERROR;
0 commit comments