Yep, me again!
USB device is working. I can create a ram disk, format it as FAT, set it as
a LUN device and Windows and Linux see it as an MSD device. I can read and
write to it, reliably.
I have an MT25QL256A device (32Mbyte) which is correctly connected to the
SAMA5D17 via SPI0, has a block driver, and I can format it as FAT
nsh> df
Block Number
Size Blocks Used Available Mounted on
16384 2046 2 2044 /mnt/fs
1024 1004 2 1002 /mnt/ramfs
0 0 0 0 /proc
When I run msconn it is pretty much always seen by Linux, but it's very
unpredictable with Win10 (get the connection sound, device manager sees it
as a drive, but doesn't reliably do the Windows equivalent of mounting it.
Mostly.
If I copy a 1Mbyte file to it (Ubuntu 20.04) it seems to write the file - it
appears in "Files" in Ubuntu. But if I try and eject the MSD, it tells me
one or more applications are keeping the device busy.
Windows behaviour is much quirkier but similar. The file seems not to write,
or Windows wants to fix errors, or just sits there. Eventually, if detected
properly, the file appears not to write, but an msdis followed by msconn
shows it is there....but it is corrupted if I compare to the original file
written. The size is right but it is not the same contents.
Go back to Linux, and it no longer wants to see the MSD, unless I reformat
it via nsh.
My belief is that the USB MSD, or FAT, or this flash device, is somehow not
working right for me. Everything else has absolutely been me not setting up
something right, or a stack issue, or not understanding dumb things, but I
have eventually got there (with help from you guys...thanks!). Right now,
though, this has me completely stumped again :(
Anyone seen anything like this before and got any suggestions of things for
me to look at or try tomorrow?