arduino / ArduinoCore-mbed

330 stars 195 forks source link

USBHOST coding error resulting in spurious error message #699

Open hhoppert opened 1 year ago

hhoppert commented 1 year ago

tusbh_msg_root_enable()

        res = -1;
        while (res!=0){
            res = tusbh_device_attach(dev);
            TUSB_ROOT_INFO("Device attach failed\n");
        }

This will cause a "Device attach failed" to always be printed, regardless of the outcome of the first device_attach() call.

I'll get around to a pull request, but this should be a quick fix. (working on getting USBHost more stable on Portenta Machine Control)

stickybun commented 1 year ago

@hhoppert Did you manage to get the PR in and USBHost stable? I have not been able to get HS core working reliably on H7 (https://github.com/arduino/ArduinoCore-mbed/issues/725).

Any pointers would be helpful.