Closed cogliano closed 5 years ago
yep for now you must put in a yield() or delay() to have it run the USB code since we handle MSC in 'userspace'!
although it is advised to call delay/yield when blocking wait on usb event, I just added this PR to help with this particular issue. https://github.com/adafruit/ArduinoCore-samd/pull/122
It is worth the fix since this code appears often enough in user sketch and library
while(!Serial.available()) {}
Should be fixed in the next samd core release (cdc is part of core)
I've added code to the msc_external_flash.ino example sketch to illustrate the issue. If you replace the loop routine in the sketch with this:
The sketch will crash. However, if you instead use the other while loop with the delay(50), the sketch works. Perhaps an interrupt issue? The delay() technique can be used as a work-around .
I am running this on an ItsyBitsy M4 Express