xairy / raw-gadget

USB Raw Gadget — a low-level interface for the Linux USB Gadget subsystem
333 stars 35 forks source link

Issues compiling on latest PiOS x64 #67

Closed rlewkowicz closed 2 months ago

rlewkowicz commented 2 months ago

In another post it's stated that due to newer kernels you should exclude a specific patch. I think its just the gcc version? Because I just compiled this on this same device on an older os.

/home/ryan/Repos/raw-gadget/raw_gadget/raw_gadget.c: In function ‘gadget_resume’:
/home/ryan/Repos/raw-gadget/raw_gadget/raw_gadget.c:407:36: error: ‘USB_RAW_EVENT_RESUME’ undeclared (first use in this function); did you mean ‘USB_RAW_EVENT_CONTROL’?
  407 |         ret = raw_queue_event(dev, USB_RAW_EVENT_RESUME, 0, NULL);
      |                                    ^~~~~~~~~~~~~~~~~~~~
      | 

I don't think gcc8 is prebuilt for this so thats a pain.

xairy commented 2 months ago

I think your raw_gadget.h file is out of date compared to raw_gadget.c, so try updating it to match this.

This issue is not related to that patch for newer kernels.

rlewkowicz commented 2 months ago

Ok, so if you're like me, you're out here trying to find a gadget api thats not a composite. I like gadget fs, but all the examples are composite and I need more granularity.

This whole space is esoteric and there's very little hand holding and example. Many projects speak starting as if you're a 10 year embedded c dev.

More or less, you don't have to build this. modprobe raw-gadget. He says that, but idk what its even called. Right like there's no ops doc for any of this

That's it. The build process actually causes stuff to break.