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 89e67d3 commit 1ffb4d7Copy full SHA for 1ffb4d7
drivers/source/usb/USBMSD.cpp
@@ -572,6 +572,14 @@ void USBMSD::_read_next()
572
573
void USBMSD::memoryWrite(uint8_t *buf, uint16_t size)
574
{
575
+ // Max sized packets are required to be sent until the transfer is complete
576
+ MBED_ASSERT(_block_size % MAX_PACKET == 0);
577
+ if ((size != MAX_PACKET) && (size != 0)) {
578
+ _stage = ERROR;
579
+ endpoint_stall(_bulk_out);
580
+ return;
581
+ }
582
+
583
if ((_addr + size) > _memory_size) {
584
size = _memory_size - _addr;
585
_stage = ERROR;
0 commit comments