Hello, I am transferring a file using USB MSD to a device, based on the Keil USB library. Can I know, when the transfer starts, how many bytes to expect? What is the indication in software as to the "end of file"?
"What is the indication in software as to the "end of file"?"
USB Mass Storage Class (MSC) doesn't directly handle "file" on the media. MSC works in lower-level media access - It handles sectors on the media, requested by the host. On the device side, there is no universal way to tell start and end of "file transfer".
When you specify the host OS (and its version) and the file system on the media, you may be able to detect the start and end of "file transfer".
Tsuneo
Thanks for your reply. Can you shortly advise me how I know that a MSD transfer has been completed? What USB event am I looking at? The thing is that the actual number of bytes received does not match the bytes indication in CBW (it is less...). I am transerring a binary file via a MSD and need to know when to trigger a transfer of the file from external RAM to internal flash. Thanks in advance.
View all questions in Keil forum