Closed jessestevens5b closed 11 months ago
My apologies for the mess above, seems my copy/paste was doing some wild stuff whilst trying to get the code and output into the above post (hopefully all fixed now)
I should also say here that I've tested with both FAT32 and FAT16 of various sizes and physical USB drives with the same behaviour
Same error with Arduino Giga R1 and a 4GB FAT32 (MBR) usb
I have the same error with the Portenta Machine control and FAT32.
Has anyone found a solution yet? Please :)
We're aware of this problem and I'm working on it right now. So far I've only been able to replicate it with one particular USB thumb drive. I've also tried the sketch above with a SanDisk Ultra USB 3.0 32 GB and a Kingston DataTraveler Exodia 32 GB multiple times, but without any error occurring. It would be helpful to hear from you which USB thumb drive models have worked and which ones have not. Until there's a fix, you might have success with using a different brand of USB thumb drive as a temporary workaround.
@alrvid yes mine were mostly Kingston, but I went on to try with several (at least 5) others of random/no name type with exactly the same problem.
Ideally it would be great to be able to see what the actual error is/means or a deeper level of debug to know what the problem is?
Thank you for your feedback! I've created a pull request (https://github.com/arduino-libraries/Arduino_USBHostMbed5/pull/23) with several fixes, including one for the I/O errors. When that's merged, I hope your code will start working. I think the merge will happen in a few days if no problems are found during the review. Please let me know if the problems persist after the fix or if they're gone.
@jessestevens5b @azolli @Sarah26-10 Hi! We've merged a few fixes since you commented here. Could you kindly try if the latest version from the main branch solves your issue?
@sebromero Hi and sorry for the long delay. I have tried it now and it works without any problems. Thanks for the update!
Closing this as this seems to be solved with the latest fixes.
I followed the example provided to write files using a Portenta Machine Control board but I'm having no luck actually writing to files.
As you can see in my code below I've mashed together the directory read example and the file writing example so I could test whether it was a general problem with my USB connection/drive but I can read the files in the directory properly, but cannot seem to write.
You'll see also below in the console print out there is no issue with the writing inside the for loop to write the numbers, only when it's time to close.
When I check the USB in my computer there is no data written to that file (it's a file I've created previously. If I delete it no new file is created).
My code:
And the console print out: