• Please review our updated Terms and Rules here

USB question--file transfer

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
44,517
Location
Pacific Northwest, USA
I've got an interesting dilemma on my hands and am trying to think of a rational solution.

I have a large MCU connected to a PC via USB. I'm using CDCACM class for text-mode interaction, but want to make data available to the connected PC for download only. The OS on the PC is nonspecific; it could be anything (MacOS, Windows, Linux, etc.), so long as it supports standard USB device types.

Normally, I'd implement the file transfer as communication with a USB MSD class, but that assumes that the host PC knows something about the file system that I'm using on the MCU (e.g. FAT32). But if I want to implement my own filesystem (for reasons of efficiency), the PC host won't know it.

So USB MSD class seems to have some drawbacks. If I were using a TCP/IP connection, I could use, say, ftp to perform the transfer, as ftp was designed to be filesystem and OS-agnostic. The same picture applies for simple file transfer such as XMODEM. But it's not a lead-pipe cinch that the PC OS will know anything about XMODEM, Kermit or other older file transfer protocols.

Basically, I'm looking for a device class or method that is filesystem-agnostic that can be hosted with standard USB classes. File transfer will be simple--the PC host gets the whole file starting at the beginning and proceeds to the end. PC-to-MCU file transfer is not supported.

Any suggestions?
 
That looks like a candidate! Now to determine how prevalent MTP is among various platform hosts.

Looks like it can even be hosted with Win XP as well (with a little hoop-jumping) under Linux. Android is fine, of course, and MacOS undoubtedly supports it.
 
That, I think, would mean encoding it as if it were a CD-ROM. MTP looks like a strong possibility. If I read the usb.org document that describes it, however, it's all mushed up as part of PTP, so it's a bit confusing.

I'll get it straightened out. What do you think of my odds of OS host support for a composite CDC+MTP device?
 
Back
Top