I hit "may not be able to detach the kernel driver for this device" on MacOS #1321
-
Hello, I try and read the HID reports on MacOS, but I get the message saying that the kernel driver cannot be detached:
What does it mean? How can I debug my keyboard on MacOS? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
libusb is not the right libray to use for HID device under macOS, as you can not detach the kernel HID driver.
I am not sure if HIDAPI can help you or not since your device is a keyboard. You can give it a try. You may want to ask in Apple forum to get some suggestions. |
Beta Was this translation helpful? Give feedback.
-
Alright, thank you for the answer! Never mind, I'll just boot my old linux laptop, I wanted a solution out-of-the-box: if it does not work directly, I'll not mess up with Apple stuff. Have you considered adding a Github discussion? I feel bad writing an issue only for asking a question. |
Beta Was this translation helpful? Give feedback.
-
We recommend using libusb-devel mailing list for technical support. There are too few libusb developers now to be able to support github discussion. |
Beta Was this translation helpful? Give feedback.
-
Well, it does not work either on Linux, but for a different reason. First Then I get:
And then my keyboard does not work anymore, I have to "reboot" it. EDIT: sorry, I did not see your last message before posting… |
Beta Was this translation helpful? Give feedback.
-
For Linux, when your use libusb and detach the kernel driver, your keyboad function will not work. That is why you need to re-attach the kernel driver once you finish the application. Therefore you should use HIDAPI as well under Linux. On the othe hand, it seems your HID device is not working well. Are you developing MCU firmware for a USB keyboard? You should consider using debugging tool for your MCU and use debugger (eg: JTAG/SWD debugger or emulator), or use UART to dump the debugging info. |
Beta Was this translation helpful? Give feedback.
-
In the end, I think we may add github discussion since some people may not like to use libusb-devel mailing list. |
Beta Was this translation helpful? Give feedback.
Yeah, that's right, how could you tell :P
My keyboard works well, I use it to type right now, but I assume that I forgot to so something in the USB class implementation…Anyway, I'll follow your advice and use HIDAPI to debug my reports.
Unfortunately, I cannot use any kind of hardware debugging because I didn't build this keyboard, and the pins are not accessible. I'm afraid of breaking everything if I do something to the board.