Skip to main content
3 of 4
lukas2005's answer is gone so edit my response for context, clarify other Pi models
jdonald
  • 3k
  • 14
  • 39

You cannot use the Raspberry Pi 3 as a USB gadget. At the time of writing this is only possible on the Raspberry Pi 0, 0W, A, A+, and 4. The Pi B+, 2, 3A+, and 3B+ lack the required pin for OTG.

If you have a Pi Zero, this gist has some examples that work with minimal configuration like g_serial, g_ether, or g_multi. For example, a minimal way to enable the serial gadget is to add dtoverlay=dwc2 to /boot/config.txt and g_serial to /etc/modules

lukas2005's original answer linked to iSticktoit.net's examples of using the more modern ConfigFS approach. The keyboard HID example is a good one to start with. And when you have only one functional micro-USB port, it becomes particularly valuable to configure multiple gadgets at a time, something that is not as readily available with the old g_* kernel modules.

jdonald
  • 3k
  • 14
  • 39