How to Test USB Gadget Drivers

When testing USB gadget, you can typically just run a couple of quick tests. I use the following two drivers to see if it is functioning properly:

  • USB Gadget Ethernet
  • USB Gadget File Storage

If the driver came from an outside source, we will assume that they did more rigorous testing (such as performance metrics). If the driver is developed internally, we will want to develop a more strict framework for testing our new driver.

USB Gadget Ethernet

See HOWTO Use USB Gadget Ethernet

  1. Bring up the interface on the board and target.
  2. Ping the host from the target device.
  3. Ping the target from the host.
  4. Transfer a file via scp.

USB Gadget File Storage

See HOWTO Use USB Gadget File Storage

  1. Create a backing file or insert a MMC/SD/CF card.
  2. Probe the file_storage driver, using the backing file or the ftl-enhanced flash device as the FILE parameter.
  3. Connect the target to the host.
  4. Transfer a file from the host to the target.
  5. Transfer a file from the target to the host.
  6. Compare the checksum with the original file.