So I've played around with the code and noticed the following behavior(windows 10):
1. It really hates it when test.txt gets deleted.
a.The file doesn't delete properly. Deleting it makes it disappear until you return to the PC directory and click on the Drive directory
again, where you can see the test.txt file with a 0kb size instead of 1024 kb. Trying to open this will throw up corrupt file
messages. Subsequent runs of the code may or may not create a test.txt file that is corrupted.
b. Any subsequent connections with the usb will throw up error messages "There's a problem with this drive. Scan the drive now a fix
it." This happens when connecting to the microSD card using an SD adapter to the PC and through the USB. Before this there are
no error messages.
c. Connection through the USB becomes much more unreliable. It takes somewhat longer to connect, sometimes it doesn't.
d. these issues are seemingly fixed when reformatting the SD card through the PC interface.
e. The amount of space used as indicated in the serial monitor seems to increase with each subsequent reset. This also
results in the test.txt file being corrupt after a few resets despite the file not being deleted in the PC interface, and
this causes all the same problems above.
f. dragging a file onto the SD card and then deleting it seemed to not turn up any issues. dragging the test.txt file
onto the desktop, renaming it something else, then dragging it back on the SD card, then deleting it didn't
have any issues, so it's probably not the size or the format/syntax of test file.
2. I had issues with the USB connection dropping of it's own accord, but this only occured when I use the 5V pin of the esp32 s2 and the uart port connection as programming/power bus. Using an external 5v power source seemed to prevent this problem from happening. Using an voltmeter shows that the 5V pin produces an output below 5v. I vaguely remember in documentation that the 5v isnt really supposed to be used for power when the power is supplied through the programming port
edit: Sometimes when it doesn't connect, going into device properties reveal this message in events.
Code: Select all
Device USB\VID_303A&PID_0002\1234-5678 was not migrated due to partial or ambiguous match.
Last Device Instance Id: USB\VID_05AC&PID_12A8\00008020001344910C12002E
Class Guid: {88bae032-5a81-49f0-bc3d-a4ff138216d6}
Location Path: PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(1)
Migration Rank: 0xF000FFFFFFFF0023
Present: false
Status: 0xC0000719
Code: Select all
Device USB\VID_303A&PID_0002\1234-5678 requires further installation.
edit 2: The Usb seems to almost always connect on the first connection after a reset, subsequent connections are less successful and often don't happen. If they do happen, they are much slower. The first connection is always very fast.
This is all the significant behavior i can notice so far. Will keep you posted on any more problems i run into.