I have been working on connecting an LPC4357 MCU to an RPi 3 via USB bulk transfer.
Because the project needs to be cross-platform so I am using libusb. On Windows, everything works fine.
For the RPi, the code compiles/links and runs mostly ok, all basic functions work such as descriptor-related functions and hot-plug functions.
However, all transfer-related functions always return LIBUSB_ERROR_TIMEOUT. I have tested both sync and async transfers, with/without explicit event handling but nothing works. When the async transfer is used, the callback of the transfer never get called despite the libusb_handle_events function is running.
I have also tried a few online examples (e.g. PyUSB). The result is same: most functions work fine except transfer functions as they still constantly gives LIBUSB_ERROR_TIMEOUT. May I ask for some insight of this problem? Could it be caused by a bug in the kernel? a bug in the libusb? MCU side error? or maybe some specific code/configuration is required for using libusb on RPi?
libusb version: 1.0.21
OS version: Raspbian (kernel 4.9.76-v7+)
USB descriptors of the device:
Dev (bus 1, device 7): NXP Semiconductors - LPC4357 GENERIC USB
- Serial Number: ABCD123456789