Windows PC as a USB slave to emulate a thumbdrive

11,216

Solution 1

You cannot do this in an application. At the lowest level, the USB ports on your computer are controlled by an Host Controller Interface. This chip will manage up to 127 slave USB devices. You would need to seriously reprogram this chip before it implements the slave side of the USB protocol. Of course, at that point any USB hub in your PC will break down - those 8 USB ports you probably have are usually implemented by 2 smart USB hubs connecting to both USB1 and USB2 host controllers. Next, your USB keyboard and mouse will stop working.

Solution 2

Most USB controllers in regular pc's dont have the possibility to function as an USB slave. So I'd start with investigating what kind of hardware you're going to use.

Another way to go: there are USB Link cables to link up 2 pc's over USB, maybe that's usable for you?

Solution 3

Take an MCU with two Slave USBs. Write a simple frimware which makes one USB act as a Special Device Class and wait until PC on this USB provides mandatory data (including Device Class, of course) for the other USB. Write a PC program which connects to the Special Device (your MCU), uploads Mass Storage Device Class and redirects I/O to a dedicated partition. The other USB on the MCU will become an emulated Mass Storage Device.

Some of those code can be taken from Linux.

Share:
11,216

Related videos on Youtube

Douglas Anderson
Author by

Douglas Anderson

Interested in abstracted tools and languages that allow focus to shift from programming to solving business problems. if (user.dad == true && user.drink == "rum" && user.arcade == "1942") { name = "douglas anderson"; }

Updated on April 15, 2022

Comments

  • Douglas Anderson
    Douglas Anderson about 2 years

    I need to create a application that will allow a Windows PC (XP/Vista) to emulate a thumbdrive. That is, when the PC is plugged into either another Windows system, or in this case, a piece of hardware that allows for USB thumbdrives to be plugged in, a folder on the computer looks like a giant thumbdrive. Any thoughts on where a guy would start to investigate this?

    Update (more specific description): I need to connect my PC to one of the newer multifuction devices that support scanning to a USB thumbdrive that is inserted into the front of the device. These units do not support WIA or TWAIN via the rear USB connector that you'd typically use for connectivity to a PC.

  • MSalters
    MSalters about 15 years
    "USB Link cables" basically are 2 USB-to-Ethernet adapters with Cat5 between them. Therefore, you need two USB masters on each side.
  • thijs
    thijs about 15 years
    that could be good because his "Client device" is a PC (which normally plays the role of master) and his host device is the scanner (which has a master chipset to be able to read from USB) But the scanner probably doesn't like that kind of cable anyway....