Programming USB device to transfer a file

Hi,

I'm trying to program a usb device that, once it's plugged into a PC, will transfer a file over.

I'm not sure what is needed to accomplish this or how to get started.

Would I use the USB mass storage class and implement the SCSI transparent command set?

Is a filesystem necessary? Do I have to write a driver? What would it look like on the computer side? Where would the file go?

As you can tell, I'm quite new to this. If someone could tell me how all the pieces fit together for this project and what information to look for to get started, I would really appreciate it.

Sigh

Reply to
sigh
Loading thread data ...

l

Any old USB thumb drive, with an autorun.inf on it, plugged into a computer nievely trusting enough to automatically execute code found on unkown media...

If the user has sensibly configured their computer, they would have to manually request the copy instead.

If your device is more than just a storage device, something like a digital camera or a datalogger instead, you would want to have a mode where it acted like a mass storage device. See the linux usb "gadget" drivers for an example.

By using the usb mass storage paradigm, you will not have to write a "driver" per se, just a user-mode program to copy your data to the right place on the host machine, and secure execute permission for it (perhaps by installing it to the computer, if it's one smart enough to mount removable drives noexec)

Reply to
cs_posting

Are you using Linux or Windows?

Reply to
_DOUG

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.