How to Patch ACM0 on Intel® Edison Boards





What are you seeing?
The USB OTG (ACM0) on the Intel® Edison Board isn't switching to host mode.

Why are you seeing it?
This issue happens when you complete a software reboot with a cable/device connected to the USB OTG. When the lsusb command is called, the system reports unable to initialize libusb: -99.

How to fix it
For the troubleshooting steps below, make sure you have an environment ready to build a standard Intel Edison Board image. You can review the requirements in the Intel® Edison Board Support Package User Guide.

Troubleshooting steps:

  1. Change directory:
    cd /meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/files/

  2. Create a file named Edison_USB_Host_Mode_Fix.patch with the following content:

    diff -urN a/drivers/usb/dwc3/dwc3-intel-mrfl.c b/drivers/usb/dwc3/dwc3-intel-mrfl.c
    --- a/drivers/usb/dwc3/dwc3-intel-mrfl.c 2015-07-17 09:55:54.556710742 -0700
    +++ b/drivers/usb/dwc3/dwc3-intel-mrfl.c 2015-07-17 10:03:21.620717760 -0700
    @@ -508,7 +508,7 @@
    int dwc3_intel_enable_vbus(struct dwc_otg2 *otg, int enable)
    - USB_EVENT_DRIVE_VBUS, &enable);
    + USB_EVENT_VBUS, &enable);
    return 0;

  3. Go back one level to this directory:

    cd /meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/

  4. Edit the linux-yocto_3.10.bbappend file and add this line:

    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

    LINUX_VERSION = "3.10.17"
    SRCREV_machine = "c03195ed6e3066494e3fb4be69154a57066e845b"
    SRCREV_meta = "6ad20f049abd52b515a8e0a4664861cfd331f684"

    SRC_URI += "file://defconfig"
    SRC_URI += "file://upstream_to_edison.patch"
    SRC_URI += "file://Edison_USB_Host_Mode_Fix.patch"


  5. Proceed to configure the Yocto build environment. To do so, change directory to / and enter the following command:

    make setup

  6. When the setup is ready, you can build the full Intel® Edison Board image with this command:

    make image

  7. You can find the images in the >/out/current/build/toFlash directory. To flash the images, use this command:

    make flash