Using the Rock3B USB OTG port as a USB HID keyboard for a windows computer

I am trying to use the USB 3 OTG port on the ROCK3B (running debian 11 OS) as a USB HID keyboard on a windows device and I wanted to know if it’s possible.

I came across a thread on this forum which tried a similar thing but that was for a ROCK 3A board which used the ubuntu image.

One of the difference I became aware of is the configfs file system in ubuntu which I could not figure out for debian.

I would appreciate if someone can guide me in achieving this.

Thanks & Regards,

Yash

Update:
Using the radxa wiki guide for Debian dev I was able to successfully generate a kernel image & debian package of the 4.19.193-1 kernel image with USB-HID device drivers enabled. This modified kernel (image and headers) was installed on my existing debian image running on the rock3B. I have verified that the new kernel is running by running the uname -r

I have run into a new problem, where in now I cannot see any overlays when I run rsetup. It says “Unable to find any compatible overlay under /boot/dtbo” inside rsetup when I try to manage overlays or view overlay info. Even when I try to rebuild overlays it says overlay data has been successfully rebuilt but when I try to view overlay data it says the same thing (unable to find any comptabile…)

Apart from this, I have confirmed that
“/lib/modules/4.19.193-1-rockchip-g67a0c0ce87a0/kernel/drivers/usb/gadget/legacy/g_hid.ko”
and
“/lib/modules/4.19.193-1-rockchip-g67a0c0ce87a0/kernel/drivers/usb/gadget/function/usb_f_hid.ko”

both exist BUT when I try to
modprobe g_hid
I get “modprobe: ERROR: could not insert ‘g_hid’: No such device”

I am quite stuck. Any sort of help or direction would be most appreciated.

Thanks & Regards

I decided to uninstall the previously installed linux kernel and generate a fresh kernel image following the same guide as before. While installing the kernel on the rock 3b board using the dpkg command I received the following errors:

root@rock-3b:/home/rock/Kernel# dpkg -i linux-image-4.19.193-1-rockchip-g67a0c0ce87a0_4.19.193-1-rockchip_arm64.deb

Selecting previously unselected package linux-image-4.19.193-1-rockchip-g67a0c0ce87a0.

(Reading database ... 121742 files and directories currently installed.)

Preparing to unpack linux-image-4.19.193-1-rockchip-g67a0c0ce87a0_4.19.193-1-rockchip_arm64.deb ...

Unpacking linux-image-4.19.193-1-rockchip-g67a0c0ce87a0 (4.19.193-1-rockchip) ...

Setting up linux-image-4.19.193-1-rockchip-g67a0c0ce87a0 (4.19.193-1-rockchip) ...

dkms: running auto installation service for kernel 4.19.193-1-rockchip-g67a0c0ce87a0:

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area........

make -j4 KERNELRELEASE=4.19.193-1-rockchip-g67a0c0ce87a0 -C /lib/modules/4.19.193-1-rockchip-g67a0c0ce87a0/build M=/var/lib/dkms/8852be/1.15.10.0.5.0-4/build.........(bad exit status: 2)

Error! Bad return status for module build on kernel: 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)

Consult /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area.......

make -j4 KERNELRELEASE=4.19.193-1-rockchip-g67a0c0ce87a0 -C /lib/modules/4.19.193-1-rockchip-g67a0c0ce87a0/build M=/var/lib/dkms/radxa-overlays/0.1.32/build........(bad exit status: 2)

Error! Bad return status for module build on kernel: 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)

Consult /var/lib/dkms/radxa-overlays/0.1.32/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area.......

make -j4 KERNELRELEASE=4.19.193-1-rockchip-g67a0c0ce87a0 -C /lib/modules/4.19.193-1-rockchip-g67a0c0ce87a0/build M=/var/lib/dkms/rtk_btusb/20220330-1/build.........(bad exit status: 2)

Error! Bad return status for module build on kernel: 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)

Consult /var/lib/dkms/rtk_btusb/20220330-1/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area...

kernelver=4.19.193-1-rockchip-g67a0c0ce87a0 ./dkms-make.sh.........(bad exit status: 2)

Error! Bad return status for module build on kernel: 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)

Consult /var/lib/dkms/rtl8852bu/1.19.3-45-g7583a804a.20230505-1/build/make.log for more information.

.

update-initramfs: Generating /boot/initrd.img-4.19.193-1-rockchip-g67a0c0ce87a0

Decompressing /boot/vmlinuz-4.19.193-1-rockchip-g67a0c0ce87a0 ...

Rebuilding overlay data folder for '4.19.193-1-rockchip-g67a0c0ce87a0'...

Removing managed overlays...

Building list of compatible overlays...

Installing compatible overlays...

Reenable previously enabled overlays...

Commiting changes...

Overlay data folder has been successfully rebuilt.

P: Checking for EXTLINUX directory... found.

P: Writing config for vmlinuz-5.10.160-39-rk356x...

P: Writing config for vmlinuz-5.10.160-18-rk356x...

P: Writing config for vmlinuz-4.19.193-1-rockchip-g67a0c0ce87a0...

P: Updating /boot/extlinux/extlinux.conf...

The errors in the make.log files are as follows:

DKMS make.log for 8852be-1.15.10.0.5.0-4 for kernel 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)
Wed 10 Sep 2025 02:13:16 PM UTC
make: Entering directory '/usr/src/linux-headers-4.19.193-1-rockchip-g67a0c0ce87a0'
  CC [M]  /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/platform/platform_linux_pc_pci.o
  CC [M]  /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/osdep_service_linux.o
  CC [M]  /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/linux/rtw_cfg.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[1]: *** [scripts/Makefile.build:333: /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/platform/platform_linux_pc_pci.o] Error 126
make[1]: *** Waiting for unfinished jobs....
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[1]: *** [scripts/Makefile.build:333: /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/linux/rtw_cfg.o] Error 126
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[1]: *** [scripts/Makefile.build:333: /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/osdep_service.o] Error 126
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[1]: *** [scripts/Makefile.build:333: /var/lib/dkms/8852be/1.15.10.0.5.0-4/build/os_dep/osdep_service_linux.o] Error 126
make: *** [Makefile:1677: _module_/var/lib/dkms/8852be/1.15.10.0.5.0-4/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.193-1-rockchip-g67a0c0ce87a0'

Similarly errors in other make.log files are

DKMS make.log for radxa-overlays-0.1.32 for kernel 4.19.193-1-rockchip-g67a0c0ce87a0 (aarch64)
Wed 10 Sep 2025 02:13:52 PM UTC
make: Entering directory '/usr/src/linux-headers-4.19.193-1-rockchip-g67a0c0ce87a0'
  CC [M]  /var/lib/dkms/radxa-overlays/0.1.32/build/radxa-overlays.o
  DTCO    /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-pwm2.dtbo
  DTCO    /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-uart1.dtbo
  DTCO    /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-uart2-m1.dtbo
/bin/sh: 1: ./scripts/dtc/dtc: Exec format error
make[2]: *** [scripts/Makefile.lib:324: /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-pwm2.dtbo] Error 126
make[2]: *** Waiting for unfinished jobs....
/bin/sh: 1: ./scripts/dtc/dtc: Exec format error
make[2]: *** [scripts/Makefile.lib:324: /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-uart2-m1.dtbo] Error 126
/bin/sh: 1: ./scripts/dtc/dtc: Exec format error
make[2]: *** [scripts/Makefile.lib:324: /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays/rk3328-uart1.dtbo] Error 126
make[1]: *** [scripts/Makefile.build:637: /var/lib/dkms/radxa-overlays/0.1.32/build/arch/arm64/boot/dts/rockchip/overlays] Error 2
make[1]: *** Waiting for unfinished jobs....
/bin/sh: 1: scripts/basic/fixdep: Exec format error
make[1]: *** [scripts/Makefile.build:340: /var/lib/dkms/radxa-overlays/0.1.32/build/radxa-overlays.o] Error 126
make: *** [Makefile:1677: _module_/var/lib/dkms/radxa-overlays/0.1.32/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.193-1-rockchip-g67a0c0ce87a0'

My build process is as follows:

I am building the u-boot, kernel and debia package on a virtual machine which runs debian 11.

I then rsync the files over ssh from the build machine to the target board (radxa rock 3 b) and then try and install the kernel packages…

Where am I going wrong?