[Error 12/Error 5] When using usb4java on Windows

49 views
Skip to first unread message

Ian Koerich Maciel

unread,
Jun 18, 2018, 5:19:46 PM6/18/18
to usb4java
Hi everyone,

# A little context:
I am working on a programming tool for embedded devices called jOCD. It's open source and available at https://github.com/fundacaocerti/jocd 
This tool is multi-platform and currently support Android, Linux... and if any of you could help me Windows might be supported as well.
For Android, there is a USB implementation using Android USB Manager, and for Linux/Windows we are using usb4java.

# About the device:
The device that is connected is a micro:bit board which is a "Mbed board". This is a 3-interfaces device (arm-3-interfaces.png). I have an official driver provided by ARM:
What I need is the 3rd interface, which is a CMSIS-DAP interface.

# The problem:
I can't get this working on Windows. It's already working on Linux, so I supposed that my problems are related with drivers.

# What I did:
Using the ARM's driver, I get libusb0 installed on 3rd interface (iface3-libusb0.png). It throws me Error 12: Can't open device Bus 001 Device 008: ID 0d28:0204: Operation not supported or unimplemented on this platform.
This error happened when I try to get te ProductString "device.getProductString();"

Than, I tried to change the driver for others compatible drivers (iface3-libusbK.png, iface3-WinUSB.png...). I Got the same result.

For last, I tried to replace the driver of the entire device. Not only for interface 3 (new-driver-libusbK.png).
Even if it looks weird for me, it did give me different (better) results.
I could now get the "device.getProductString();", and other strings.
But, the problem turned to new one: when I try to write (using pipe.syncSubmit(...)) - at line 281, I get: "USB error 5: Can't open device Bus 001 Device 006: ID 0d28:0204: Transfer error on interrupt endpoint: Entity not found"

# Sources
The sources of this implementation if available at the mentioned repository (branch feature/fix-usb4java-on-windows). The USB interface is at this URL: https://github.com/fundacaocerti/jOCD/blob/bugfix/fix-usb4java-on-windows/jocd-conn-usb4java/src/main/java/br/org/certi/jocdconnusb4java/connectioninterface/Usb4JavaDevice.java

The first problem (Error 12) happens at line 116.
USB error 12: Can't open device Bus 001 Device 008: ID 0d28:0204: Operation not supported or unimplemented on this platform

The second problem (Error 5) happens at line 281.
USB error 5: Can't open device Bus 001 Device 006: ID 0d28:0204: Transfer error on interrupt endpoint: Entity not found

Any help is very welcome.

Thanks in advance.
Best Regards,
Ian Maciel


Reply all
Reply to author
Forward
0 new messages