Closed gdsports closed 1 year ago
Worked for me on pi4. I didn't use checkout however.
As I recall, the build worked for Pi4 but the file does not work. I had to checkout the older source code to make sure the Pi4 version of usb_f_hid.ko works. But perhaps there is a difference between building on Pi versus Ubuntu. I was cross compiling on Ubuntu but my friend wants to build on Pi. I will verify the drivers work when done. I should switch to a USB 3.0 SSD or hard drive. SD card is too slow. I can eliminate the checkout if it is not really needed.
I can also repeat compiling again. The only change I made was changing kernel/drivers/usb/gadget/function
to drivers/usb/gadget/function
and it worked on Pi4. Raspberry Pi Desktop could be another option as dual boot on PC for compiling it faster. I might try that.
Here's what I did and works well:
sudo git clone --depth=1 --branch rpi-5.10.y https://github.com/raspberrypi/linux
cd linux
made changes to f_hid.c and then:
DEST=${HOME}/RaspberryPi-Joystick/XACGamepad/Drivers
TAIL=drivers/usb/gadget/function
NUMCPU=4
and the rest is the same.
KERNEL=kernel
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
make -j ${NUMCPU} ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
DESTDIR="${DEST}/5.10.11+/${TAIL}"
...
The whole repo must be cloned. Using "--depth=1" does not work.
I helped someone setup a Pi to do kernel builds and found my instructions do not work. :(