I know this topic has been discussed quite a few times, but I never seen a complete solution. So, again...

Is there any way to make an RPi emulate a USB mass storage device?

Please do not waste your discussion yelling, for example, that RPi lacks a USB device port, etc. I know this needs a proper hardware interface and OTG/gadget driver.

My goal is to let a black box device such as an STB (set-top box) that accepts and knows only an external USB mass storage device such as a flash drive connect to an RPi through some commercially available hardware device and think it is really using a USB mass storage. This way, the RPi can update and read the mass storage contents as the STB does so. I meant "black box" because it cannot be modified at all; it only knows about an external USB mass storage device.

I know there are issues like cache coherency on the STB side (i.e. the STB may not detect contents updates made by the RPi because the STB caches the contents and believes he is the only storage user), but it could be solved, for example, by emulating disconnecting the USB mass storage, period.

I am not particularly interested in developing such a thing by myself, for example, by using GPIO to emulate USB, etc. I am looking for a read-to-use solution.

Does anyone know what I am looking for?

Thanks. hiro

  • 6
    Yes, we know what you are looking for.
    – joan
    Jul 17, 2015 at 7:22
  • 1
    I know that this thread is quite old. I've tried to sketch a solution here: superuser.com/a/1613829/547193. You should be able to store files to and read files from a NAS. But Raspberry Pi alone works also - with the limited space of your flash memory. Dec 31, 2020 at 12:41

1 Answer 1


Have a look at http://pi.gbaman.info/?p=699 which shows how to do the USB mass storage bit. But you might need an extra USB port from somewhere...

  • The link appears dead, so this answer no longer contains any usable information.
    – Andreas
    Dec 30, 2022 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.