Closed JetSetIlly closed 1 year ago
I've also tried the rawread program (from the gousb repository) and ran it with the appropriate interface/endpoint arguments. I receive the same log messages.
sorry, I don't think we can help with such development issues. That being said, if you can see that a C/libusb program works as expected while gousb doesn't, then it's possible the problem lies within gousb and I would take a look.
my personal guess would be that the device needs some kind of setup before it starts transmitting - perhaps the right configuration needs to be selected on the device, or some control command needs to be sent before endpoint data is produced.
I assume that it is obvious to you that reading data from the USB endpoint and reading data from the ttyACM device through the ACM driver are two completely different things and that if your device uses a serial port emulation of some kind, you will have to manually implement some additional protocol on top of raw USB.
Also make sure your device resets correctly (that may be the difference between first use, when Linux kernel attaches the driver for the endpoint, and the second use, when your aplication detaches and claims the endpoint itself).
Understood. I now think it's probably a USB hardware issue on the micro controller.
using Wireshark to snoop on USB packets in a case where it does and doesn't work may be enlightening.
Hello,
I have a STM32 microcontroller (bluepill) that I have successfully set up with a small program to emit data on the USB port. When connected with the cu program (connecting to the /dev/ttyACM0 device) I receive the stream of data. This proves that the bluepill is working as I expect.
I am now trying to use gousb to retrieve the data. I am using the example programs from the package's documentation as a basis for a test program. The logs indicate that I am finding the correct device and successfully opening the In endpoint.
The problem seems to be that the in.Read() function never returns. I see this debug message on the call to Read:
and then repeated messages thereafter:
I'm not sure how to proceed from here. Permissions to the usb device are correct and the device itself is functioning as I expect. Is there a configuration step that I have misunderstood?
I include the complete test program as a gist for reference: https://gist.github.com/JetSetIlly/52ae2f639f7d524a1fa58dac91b950ff