Skip to content

Commit

Permalink
Make project buildable on macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Hieu Tran Dang <dangtranhieu2012@gmail.com>
  • Loading branch information
dangtranhieu2012 authored and gibsson committed Mar 13, 2017
1 parent deaaea5 commit a2cf488
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -49,6 +49,17 @@ project requires libusb to be present at ../../libusb (relative to the msvc)
directory. If you use an alternative location or compile libusb from source
too, you will have to alter the include/library path in the project settings.

### macOS

libusb and pkg-config can be installed via Homebrew.

If imx_usb fails to claim interface, com.apple.driver.usb.IOUSBHostHIDDevice
needs to be unloaded so libusb can claim, run:

```
sudo kextunload -b com.apple.driver.usb.IOUSBHostHIDDevice
```

## Usage
Using USB, your device should be detected automatically using the USB
VID/PID from imx_usb.conf. Using UART, the user has to specify a
Expand Down
3 changes: 3 additions & 0 deletions portable.h
Expand Up @@ -25,6 +25,9 @@ extern int debugmode;
#ifdef __linux__
#include <linux/limits.h>
#endif
#ifdef __APPLE__
#include <sys/syslimits.h>
#endif
#ifdef __FreeBSD__
#include <sys/param.h>
#endif
Expand Down

2 comments on commit a2cf488

@jonentropy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, do you know how to make this work on High Sierra?
It seems that sudo kextunload -b com.apple.driver.usb.IOUSBHostHIDDevice does not work.

@dangtranhieu2012
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, do you know how to make this work on High Sierra?
It seems that sudo kextunload -b com.apple.driver.usb.IOUSBHostHIDDevice does not work.

Sorry, took me a while to realize there is a comment here so a bit late response. Anyway, the idea is to stop whatever is claiming your device to let imx_usb_loader has a chance to use it. On my board, it was com.apple.driver.usb.IOUSBHostHIDDevice but if that doesn't work for you, it's likely some other module is claiming and so you have to unload that one instead, check dmesg to see which one.

Please sign in to comment.