Closed BOBILLIER closed 3 years ago
Just to add something, the USB1 key is 8GB and USB2 32GB. The problem is closely related to the first write to the file, even if the file already exists. Moreover, if I subsequently create another file in addition to the first one, I also get the same long times when I write to the first one for the first time. I can't tell if it's from this library, from USBHost_t36, or the filesystem. Have you observed this problem?
This could be an affect of the thumb drive or possibly the filesystem. I have seen this before as well but have not gone to deep into figuring out why. I do know that USB mass storage drives can stall a transfer during a period of time probably to flush data cached in it's internal buffers. Icannot give you a definite reason why.
BOBILLIER
I will checkout the benchUSB sketch. I think I was just using that but will double check to see If I did something to it that may have broke it.
BOBILLIER
I guess I need to update all of the example files in 'UsbMscFat-FS_dates'. With this version of UsbMscFat we are now using PFsFile instead of FsFile. So all of the examples that use 'FsFile' in the sketch need to be changed to 'PFsFile'. In 'benchUSB.ino' this would be line #66. Change 'FsFile file. to 'PFsFile file. The it works.
You are right. It's a key problem. I have to benchmark it on my computer and obtain a same write time (near 3s) during first write cycle for my 32GB. (Verbatim Nano USB2). I correct PFsFile text and all work fine.
I have made a writing test sketch to evaluate the delay of a writing cycle on my T3.6, and I obtain high delay during the first write cycle solely and especially during the close file cycle. I have made a test on two different USB sticks and obtain: USB Stick 1 : First write : Open and Write = 4ms / Close = 156ms, Second write(and next): O&W = 3ms / C = 12ms USB Stick 2 : First write : Open and Write = 2ms / Close = 3000ms, Second write(and next): O&W = 1ms / C = 4ms As you can see for USB Stick 2, the Close cycle can be really high. I'm not sure that this delay is only the fact of the stick.
Here my test program. You have just to press 'w' in the com terminal to run the write cycle. Essai_init_USB.zip
I have tested your BenchUSB example, but it only returns Write-Read errors.
On the other hand, do you know if your library is thread compatible?