I'm using a frdm-kl25z board. I'm trying to connect the board to a
yamaha THR10 amplifier through a USB connection. The USB on
the frdm board is running in host mode.
The goal is to get a pipe handle to endpoint 1 on interface 3. So
far I haven't succeded. The attach event is correctly received but
everytime i run: _usb_hostdev_select_interface() I get an error.
Error nr. 200 / USBERR_NO_DESCRIPTOR.
Any help as to why this happens is greatly appreciated.
I have attached the device descriptor (output of lsusb command
on linux)
Original Attachment has been moved to: lsusb_thr.txt.zip
Sorry for the late response, I've been a bit busy lately.
I think I finally found the root of the problem. I single stepped through the _usb_hostdev_select_interface() and discovered that the device descriptor isn't received or parsed correctly.
As far as i can tell the device descriptor is saved in the dev variable. dev->num_of_interfaces contains a value of 1 although the device actually have 4 interfaces.
When obtaining the device descriptor from Linux it turns out that there are some unrecognised fields or commands in the descriptor, see the file attached to the first post. These unrecognised fields appear for the first time right after the description of the first interface. My guess is that the freescale usb stack can't handle these so the function responsible for parsing the device descriptor exits without parsing the rest of the descriptor. This would explain why dev->num_of_interfaces returns 1.
Good ideas for solving this are welcome. I have yet to find where the function that parses the device descriptor is located.
Hello Kristian,
The “Freescale MQX USB Host API Reference Manual” document provides guidelines for the Host functions usage. This document is available at the following path, considering MQX default installation paths:
C:\Freescale\Freescale_MQX_4_0\doc\usb\MQXUSBHOSTAPIRM.pdf
Hope this will be useful for you.
Best regards!
/Carlos
Yup -- that's the documentation that is a dry list of API calls, with no information on how to use them in sequence to open an endpoint and, by poll or interrupt, transfer some blocks of data (and recover from errors!).
I personally found the documentation on Endpoints 'lacking' in operational detail, and any examples of endpoints 'nonexistant', for my device transferring data on Endpoint 1. I finally just 'opened' some pipes, and at least in poll mode (NOT my favorite plan) I do manage to get my data. If you will email me, I can certainly send what I have done to you as an 'example' that at least works.