libUSB + Gadget Zero?

Discussion in 'Computer Programming, Emulation, and Game Modding' started by gudenau, Nov 3, 2016.

  1. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,225
    Jul 7, 2010
    United States
    /dev/random
    I have a Raspberry Pi Zero that has the Gadget Zero module installed, it shows up just fine on my Windows 10 computer and I was able to install libUSB drivers for it just fine. My problem is that every time I try to use libUSB to send the eight bytes "0001020304050607" and read it back the IN endpoint always returns saying it's not found. I'm using endpoints 0x01 and 0x81. When I try to use the setConfiguration method it's always an illegal parameter as well.

    Does anyone have a good simple example for using Gadget Zero with libUSB?
     
  2. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,225
    Jul 7, 2010
    United States
    /dev/random
    This is in my kernel log on the Pi.
    Code:
    zero gadget: bad OUT byte, buf[0] = 1
     
  3. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,225
    Jul 7, 2010
    United States
    /dev/random
    Looks like I needed to pass "pattern=1" to insmod.