You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bulding hidapi under NetBSD with the uhid backend is okay
netbsdvm$ cmake .. -D HIDAPI_BUILD_HIDTEST=1 -D CMAKE_C_FLAGS=-I/usr/pkg/include -D CMAKE_EXE_LINKER_FLAGS=-R/usr/pkg/lib -DCMAKE_INSTALL_PREFIX=/usr/pkg
-- The C compiler identification is GNU 10.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- hidapi: v0.16.0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HIDAPI_ICONV_CONST
-- Performing Test HIDAPI_ICONV_CONST - Failed
-- Found PkgConfig: /usr/pkg/bin/pkg-config (found version "2.4.3")
-- Checking for module 'libusb-1.0>=1.0.9'
-- Found libusb-1.0, version 1.0.29
-- Check for Iconv
-- Performing Test Iconv_IS_BUILT_IN
-- Performing Test Iconv_IS_BUILT_IN - Success
-- Found Iconv: built in to C library
-- Building hidtest
-- Configuring done (5.3s)
-- Generating done (0.3s)
-- Build files have been written to: /home/mcuee/build/hidapi/build_cmake
netbsdvm$ make
[ 16%] Building C object src/netbsd/CMakeFiles/hidapi_netbsd.dir/hid.c.o
[ 33%] Linking C shared library libhidapi-netbsd.so
[ 33%] Built target hidapi_netbsd
[ 50%] Building C object src/libusb/CMakeFiles/hidapi_libusb.dir/hid.c.o
[ 66%] Linking C shared library libhidapi-libusb.so
[ 66%] Built target hidapi_libusb
[ 83%] Building C object hidtest/CMakeFiles/hidtest.dir/test.c.o
[100%] Linking C executable hidtest
[100%] Built target hidtest
netbsdvm$ sudo make install
Password:
[ 33%] Built target hidapi_netbsd
[ 66%] Built target hidapi_libusb
[100%] Built target hidtest
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/pkg/lib/libhidapi-netbsd.so.0.16.0
-- Up-to-date: /usr/pkg/lib/libhidapi-netbsd.so.0
-- Up-to-date: /usr/pkg/lib/libhidapi-netbsd.so
-- Up-to-date: /usr/pkg/include/hidapi/hidapi.h
-- Installing: /usr/pkg/lib/pkgconfig/hidapi-netbsd.pc
-- Installing: /usr/pkg/lib/libhidapi-libusb.so.0.16.0
-- Up-to-date: /usr/pkg/lib/libhidapi-libusb.so.0
-- Set non-toolchain portion of runtime path of "/usr/pkg/lib/libhidapi-libusb.so.0.16.0" to ""
-- Up-to-date: /usr/pkg/lib/libhidapi-libusb.so
-- Up-to-date: /usr/pkg/include/hidapi/hidapi.h
-- Up-to-date: /usr/pkg/include/hidapi/hidapi_libusb.h
-- Installing: /usr/pkg/lib/pkgconfig/hidapi-libusb.pc
-- Installing: /usr/pkg/lib/cmake/hidapi/libhidapi.cmake
-- Installing: /usr/pkg/lib/cmake/hidapi/libhidapi-release.cmake
-- Installing: /usr/pkg/lib/cmake/hidapi/hidapi-config-version.cmake
-- Installing: /usr/pkg/lib/cmake/hidapi/hidapi-config.cmake
-- Installing: /usr/pkg/bin/hidtest
-- Set non-toolchain portion of runtime path of "/usr/pkg/bin/hidtest" to ""
netbsdvm$ sudo /usr/pkg/bin/hidtest
hidapi test/example tool. Compiled with hidapi version 0.16.0, runtime version 0.16.0.
Compile-time version matches runtime version of hidapi.
Device Found
type: 0925 1234
path: uhidev1
serial_number:
Manufacturer: CYPRESS
Product: EZ-USB FX2 HID USBHIDIO
Release: 0
Interface: -1
Usage (page): 0x1 (0xffa0)
Bus type: 1 (USB)
Report Descriptor: (52 bytes)
0x06, 0xa0, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x09, 0x02, 0xa1,
0x00, 0x06, 0xa1, 0xff, 0x09, 0x03, 0x09, 0x04, 0x15, 0x80,
0x25, 0x7f, 0x35, 0x00, 0x45, 0xff, 0x75, 0x08, 0x95, 0x80,
0x81, 0x02, 0x09, 0x05, 0x09, 0x06, 0x15, 0x80, 0x25, 0x7f,
0x35, 0x00, 0x45, 0xff, 0x75, 0x08, 0x95, 0x80, 0x91, 0x02,
0xc0, 0xc0,
unable to open device
building hidapitester using Makefile does not work, but using CMake works.
netbsdvm$ mkdir build
netbsdvm$ cd build/
netbsdvm$ cmake ..
-- The C compiler identification is GNU 10.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- hidapitester version: v0.5
-- Using local HIDAPI from: /home/mcuee/build/hidapitester/../hidapi
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HIDAPI_ICONV_CONST
-- Performing Test HIDAPI_ICONV_CONST - Failed
-- Found PkgConfig: /usr/pkg/bin/pkg-config (found version "2.4.3")
-- Checking for module 'libusb-1.0>=1.0.9'
-- Found libusb-1.0, version 1.0.29
-- Check for Iconv
-- Performing Test Iconv_IS_BUILT_IN
-- Performing Test Iconv_IS_BUILT_IN - Success
-- Found Iconv: built in to C library
-- Configuring done (1.8s)
-- Generating done (0.2s)
-- Build files have been written to: /home/mcuee/build/hidapitester/build
netbsdvm$ make
[ 25%] Building C object hidapi/src/netbsd/CMakeFiles/hidapi_netbsd.dir/hid.c.o
[ 50%] Linking C static library libhidapi-netbsd.a
[ 50%] Built target hidapi_netbsd
[ 75%] Building C object CMakeFiles/hidapitester.dir/hidapitester.c.o
[100%] Linking C executable hidapitester
[100%] Built target hidapitester
Unfortunately even forcing the device to enumerate as a full speed USB device does not work. That was the issues with PR Add hidraw backend for FreeBSD #730 under FreeBSD.
PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage modifyvm "netbsd101vm" --usb-ohci on --usb-ehci off --usb-xhci off
Run log with the FX2HID default example with two bytes HID Input/Output report.
[mcuee@netbsdvm hidapitester]$ uname -a
NetBSD netbsdvm 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
[mcuee@netbsdvm hidapitester]$ sudo ./hidapitester --list
0925/1234: CYPRESS - EZ-USB FX2 HID USBHIDIO
[mcuee@netbsdvm hidapitester]$ sudo ./hidapitester --vidpid 0925:1234 --list-detail
0925/1234: CYPRESS - EZ-USB FX2 HID USBHIDIO
vendorId: 0x0925
productId: 0x1234
usagePage: 0xFFA0
usage: 0x0001
serial_number:
interface: -1
path: uhidev1
[mcuee@netbsdvm hidapitester]$ sudo ./hidapitester --vidpid 0925:1234 --open --buflen 64 -l 3 --send-output 0,1,2 --read-input
Opening device, vid/pid: 0x0925/0x1234
Writing output report of 3-bytes...wrote -1 bytes:
00 01 02
Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
Closing device
[mcuee@netbsdvm hidapitester]$ sudo usbdevs
addr 1: OHCI root hub, NetBSD
addr 2: USB Tablet, VirtualBox
addr 3: product 1234, vendor 0925
[mcuee@netbsdvm hidapitester]$ sudo usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), NetBSD(0x0000), rev 1.00(0x0100)
port 1 addr 2: full speed, power 100 mA, config 1, USB Tablet(0x0021), VirtualBox(0x80ee), rev 1.00(0x0100)
port 2 addr 3: full speed, power 80 mA, config 1, product 1234(0x1234), vendor 0925(0x0925), rev 0.00(0x0000)
port 3 powered
port 4 powered
port 5 powered
port 6 powered
port 7 powered
port 8 powered
port 9 powered
port 10 powered
port 11 powered
port 12 powered
CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID). #590 (comment)
It is mostly working except for the last case -- somehow Input Report ID 1 is missing.
Using a physical machine, Intel N4200 CPU based mini PC
CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID).
Interestingly it work for the odd time but failed for the even time.
Activity
mcuee commentedon Apr 26, 2026
mcuee commentedon Apr 26, 2026
mcuee commentedon Apr 26, 2026
However, it does not seem to work with the FX2HID example.
Using the original FX2HID example from Jan Axelson.
http://janaxelson.com/hidpage.htm
Run log with the FX2HID default example with two bytes HID Input/Output report.
mcuee commentedon Apr 26, 2026
I will test with a physical machine and another generic USB HID device.
mcuee commentedon Apr 27, 2026
Still using VM but changes to another Generic USB HID device mentioned here. The device works fine under FreeBSD 15 VM using PR #730.
Feature Report loopback is working fine but Input/Output loopback does not work under NetBSD 10.1 VM.
mcuee commentedon May 1, 2026
Still using VirtualBox VM.
CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID).
#590 (comment)
It is mostly working except for the last case -- somehow Input Report ID 1 is missing.
mcuee commentedon May 2, 2026
Using a physical machine, Intel N4200 CPU based mini PC
CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID).
Interestingly it work for the odd time but failed for the even time.
mcuee commentedon May 2, 2026
Same for the physical machine.