I've created a composite USB device using the "Interface Association" protocol. The device includes a single channel usb audio class device (which behaves like a microphone, and sends uLaw audio at 8000 hz), as well as a second interface which is vendor specific and sends data from an SPI sensor.
When i start everything up, it seems to work. If, however, the board gets re-enumerated by the host, problems arise. I'm using LIBUSB to read a bulk stream from that second interface, and it returns EPROTO. the audio interface still works.
This device uses a ULPI phy on the USB_HS interface
One of my target computers initializes USB devices several times when cold-booting, so I need to find a fix. Is there a general strategy to ensure this? can i re-initialize the USB peripheral when i get a USB_RESET event?
edit: i'll add the detail that i'm using an STM32F427, and chibios 18.2.1
USB Initialization
Re: USB Initialization
Update:
I tried re-initializing the whole USB peripheral on a USB_RESET event, that just caused more problems. It's so strange that most of my endpoints (the audio ones) seem to work fine, but the one bulk endpoint which relies on libusb fails under these conditions...
I tried re-initializing the whole USB peripheral on a USB_RESET event, that just caused more problems. It's so strange that most of my endpoints (the audio ones) seem to work fine, but the one bulk endpoint which relies on libusb fails under these conditions...
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: USB Initialization
Hi,
The reset event does re-initialize the USB peripheral already, probably there is something else. The CDC demos can get reinitialized without problems.
Not sure how to help here.
Giovanni
The reset event does re-initialize the USB peripheral already, probably there is something else. The CDC demos can get reinitialized without problems.
Not sure how to help here.
Giovanni
-
- Posts: 77
- Joined: Sat Mar 19, 2016 8:07 pm
- Been thanked: 17 times
Re: USB Initialization
I'd take a look at what's going on on the usb bus by dumping the URBs going over the wire.
The easiest way to do this is usually to use the usbmon facility from the linux kernel. If you are using a windows program to communicate, run a linux host, start windows as a vm (qemu and kvm) inside it and attach the usb device to the vm. This way the linux kernel can still dump all URBs going in and out of the windows vm.
To understand the contents of the dumped URBs you unfortunately need to have a deeper understanding of usb and the protocols used with it.
The easiest way to do this is usually to use the usbmon facility from the linux kernel. If you are using a windows program to communicate, run a linux host, start windows as a vm (qemu and kvm) inside it and attach the usb device to the vm. This way the linux kernel can still dump all URBs going in and out of the windows vm.
To understand the contents of the dumped URBs you unfortunately need to have a deeper understanding of usb and the protocols used with it.
Who is online
Users browsing this forum: No registered users and 26 guests