Author Topic: bootloadHID on OSX  (Read 2333 times)

0 Members and 1 Guest are viewing this topic.

Offline aaronz8

  • Thread Starter
  • Posts: 27
bootloadHID on OSX
« on: Tue, 27 January 2015, 16:17:06 »
I'm trying to use bootloadHID on OSX to load a keymap onto my Sprit pcb. Unfortunately, BootloadHID uses libusb, which isn't fully compatible with OSX:

    Warning: could not detach kernel HID driver: Function not implemented

The OSX HID driver takes over for HID devices and does not allow detaching, and this breaks libusb, which in turn breaks BootloadHID.

Does anybody have a workaround for this, other than using Linux or Windows?

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: bootloadHID on OSX
« Reply #1 on: Tue, 27 January 2015, 18:03:57 »
Sorry. My work around was to use Parallels or VMware Fusion and then use Windows. I also ran into the same problem and after spending way too long trying to compile all the usblib stuff from source and such, caved and just did it on Windows. Sorry, I know that's not what you wanted to hear. Its not what I wanted to hear either...  :(

Offline aaronz8

  • Thread Starter
  • Posts: 27
Re: bootloadHID on OSX
« Reply #2 on: Wed, 28 January 2015, 14:50:43 »
Funny, I had a dream about getting this working last night... then I woke up...

Sorry. My work around was to use Parallels or VMware Fusion and then use Windows. I also ran into the same problem and after spending way too long trying to compile all the usblib stuff from source and such, caved and just did it on Windows. Sorry, I know that's not what you wanted to hear. Its not what I wanted to hear either...  :(

Yeahhh, looks like I'll have to do that too. Thanks though for the reply! Perhaps one of these days I'll read more into the OSX HID driver and see if it can be shimmed to work with libusb.

Offline mecano

  • Posts: 141
  • Location: France
Re: bootloadHID on OSX
« Reply #3 on: Wed, 28 January 2015, 14:58:42 »
Using homebrew? 1.0.19 stable?
No idea if it can works, and it will more than probably fail, but FreeBSD got a reimplementation here : http://svnweb.freebsd.org/base/head/lib/libusb/

Offline aaronz8

  • Thread Starter
  • Posts: 27
Re: bootloadHID on OSX
« Reply #4 on: Wed, 28 January 2015, 15:07:00 »
Using homebrew? 1.0.19 stable?
No idea if it can works, and it will more than probably fail, but FreeBSD got a reimplementation here : http://svnweb.freebsd.org/base/head/lib/libusb/

libusb 1.x.x doesn't have a `libusb-config` command, so I assumed BootloadHID to be only compatible with libusb 0.x.x. Here's what I did to install:

brew install libusb-compat
cd ~/Downloads/bootloadHID.2012-12-08/commandline
make

I haven't checked if libusb 1.x.x fixes the problem yet, but at http://libusb.org/wiki/FAQ#CanIcreateadriverlessdeviceusingHIDclass they suggest using  http://www.signal11.us/oss/hidapi/ to interface directly with HID devices.

Offline mecano

  • Posts: 141
  • Location: France
Re: bootloadHID on OSX
« Reply #5 on: Wed, 28 January 2015, 15:52:50 »
Or change bootloadHID code to use pkg-config instead of libusb-config?

Sounds really weird for a soft coming from OBDev that this doesn't work on OSX (or maybe it's because of some security restrictions of newer OSXes)…
I see last update in 2012, not that far… Should be 10.8 and backward compatible, what do you think?

I'm really not familiar with what you are trying to achieve but it about AVR right? Would AVRDude be of any use there?

Offline aaronz8

  • Thread Starter
  • Posts: 27
Re: bootloadHID on OSX
« Reply #6 on: Wed, 28 January 2015, 20:09:31 »
Or change bootloadHID code to use pkg-config instead of libusb-config?

Sounds really weird for a soft coming from OBDev that this doesn't work on OSX (or maybe it's because of some security restrictions of newer OSXes)…
I see last update in 2012, not that far… Should be 10.8 and backward compatible, what do you think?

I'm really not familiar with what you are trying to achieve but it about AVR right? Would AVRDude be of any use there?

Older versions of OSX had a workaround where you could override the kernel driver with an empty kext, thus allowing the driver detachment from userland. However newer OSXs have patched this so it no longer works.

I think AVRDude requires the use of a programmer whereas BootloadHID is a USB bootloader, meaning it can be flashed via USB. It's nice because it's implemented as a USB HID device, so ideally it can be flashed without any driver other than the one included in the OS.

For now, I think I'm going to stick with manual ps2avru keymapping - I've only got a few keys to add so it's probably not worth the time to debug bootloadHID and libusb further. I'll save it for rainy days :)