* [ECOS] USB-CDC eCos configuration
@ 2007-08-27 7:20 wavecom wavecom
2007-08-27 7:33 ` Andrew Lunn
0 siblings, 1 reply; 5+ messages in thread
From: wavecom wavecom @ 2007-08-27 7:20 UTC (permalink / raw)
To: ecos-discuss
Hi All,
I'm working on USB-CDC eCos based device. I've met
some problems with initializing the device:
Windows recognizes the device as another COM port, but
when I'm trying to open the port by the hyperterminal,
I have message "Could not open COM port". What would
be the cause of such behavior, below result of lsusb
-vvv command on Linux (I can also send my c-code of
USB initialization if necessary).
Second question is, how to set Functional Descriptors
like CDC Header, CDC ACM, CDC Union, CDC Call
Management? Are these parameters necessary for proper
operating the USB-CDC device?
I'm using AT91SAM7S-EK.
"
Bus 002 Device 012: ID 03eb:6125 Atmel Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x03eb Atmel Corp.
idProduct 0x6125
bcdDevice 1.10
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 48
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0 None
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
"
Pete
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] USB-CDC eCos configuration
2007-08-27 7:20 [ECOS] USB-CDC eCos configuration wavecom wavecom
@ 2007-08-27 7:33 ` Andrew Lunn
2007-08-27 12:16 ` wavecom wavecom
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2007-08-27 7:33 UTC (permalink / raw)
To: wavecom wavecom; +Cc: ecos-discuss
On Mon, Aug 27, 2007 at 12:20:20AM -0700, wavecom wavecom wrote:
> Hi All,
>
> I'm working on USB-CDC eCos based device.
I presume you are writing your own USB-CDC driver? I don't think one
exists for eCos yet.
> I've met some problems with initializing the device: Windows
> recognizes the device as another COM port, but when I'm trying to
> open the port by the hyperterminal, I have message "Could not open
> COM port". What would be the cause of such behavior, below result of
> lsusb -vvv command on Linux (I can also send my c-code of USB
> initialization if necessary).
Do you have a trace of the USB messages sent backwards and forwards
when the device is opened? Does your driver handle all these messages?
> Second question is, how to set
> Functional Descriptors like CDC Header, CDC ACM, CDC Union, CDC Call
> Management? Are these parameters necessary for proper operating the
> USB-CDC device?
What does the standard say? Is there a standard? Is this part of HID?
What does Linux make of this device? Maybe you can get better
diagnostics from Linux than from M$. At least with Linux you have the
source code so you can find out why Linux does not like your
driver....
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] USB-CDC eCos configuration
2007-08-27 7:33 ` Andrew Lunn
@ 2007-08-27 12:16 ` wavecom wavecom
2007-08-27 20:01 ` Andrew Lunn
0 siblings, 1 reply; 5+ messages in thread
From: wavecom wavecom @ 2007-08-27 12:16 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss
Thanks for answer,
--- Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, Aug 27, 2007 at 12:20:20AM -0700, wavecom
> wavecom wrote:
> > Hi All,
> >
> > I'm working on USB-CDC eCos based device.
>
> I presume you are writing your own USB-CDC driver? I
> don't think one
> exists for eCos yet.
Yes, it is USB-CDC driver, I was trying to find
already developed, but I couldnÂt find any.
>
> > I've met some problems with initializing the
> device: Windows
> > recognizes the device as another COM port, but
> when I'm trying to
> > open the port by the hyperterminal, I have message
> "Could not open
> > COM port". What would be the cause of such
> behavior, below result of
> > lsusb -vvv command on Linux (I can also send my
> c-code of USB
> > initialization if necessary).
>
> Do you have a trace of the USB messages sent
> backwards and forwards
> when the device is opened? Does your driver handle
> all these messages?
I didnÂt try to sniff connection, today IÂm going to
install SnoopyPro and log trace of the connection. Can
you recommend me similar software for Linux?
>
>
> > Second question is, how to set
> > Functional Descriptors like CDC Header, CDC ACM,
> CDC Union, CDC Call
> > Management? Are these parameters necessary for
> proper operating the
> > USB-CDC device?
>
> What does the standard say? Is there a standard? Is
> this part of HID?
>
> What does Linux make of this device? Maybe you can
> get better
> diagnostics from Linux than from M$. At least with
> Linux you have the
> source code so you can find out why Linux does not
> like your
> driver....
I donÂt know if the standard of USB-CDC already
exists. I suppose that parameters are important for
driver because only difference between fully
functional driver and my driver are extra Functional
Descriptors:
" CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1"
That is simple USB implementation on AT91 (without
OS). Parameters are specified in structure like below
(thatÂs a part of example given by Atmel):
/* ACM Functional Descriptor */
0x04, // bFunctionLength
0x24, // bDescriptor Type: CS_INTERFACE
0x02, // bDescriptor Subtype: ACM Func Desc
0x00, // bmCapabilities
/* Union Functional Descriptor */
0x05, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x06, // bDescriptor Subtype: Union Func Desc
0x00, // bMasterInterface: Communication Class
Interface
0x01, // bSlaveInterface0: Data Class Interface
/* Call Management Functional Descriptor */
0x05, // bFunctionLength
0x24, // bDescriptor Type: CS_INTERFACE
0x01, // bDescriptor Subtype: Call Management Func
Desc
0x00, // bmCapabilities: D1 + D0
0x01, // bDataInterface: Data Class Interface 1
That may notify driver about communication interface
and so on.
IÂd better move my driver debugging to Linux, MS
doesnÂt support any method of port debug.
>
> Andrew
>
Pete
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] USB-CDC eCos configuration
2007-08-27 12:16 ` wavecom wavecom
@ 2007-08-27 20:01 ` Andrew Lunn
2007-09-03 7:46 ` wavecom wavecom
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2007-08-27 20:01 UTC (permalink / raw)
To: wavecom wavecom; +Cc: ecos-discuss
On Mon, Aug 27, 2007 at 05:16:10AM -0700, wavecom wavecom wrote:
> Thanks for answer,
>
> --- Andrew Lunn <andrew@lunn.ch> wrote:
>
> > On Mon, Aug 27, 2007 at 12:20:20AM -0700, wavecom
> > wavecom wrote:
> > > Hi All,
> > >
> > > I'm working on USB-CDC eCos based device.
> >
> > I presume you are writing your own USB-CDC driver? I
> > don't think one
> > exists for eCos yet.
>
> Yes, it is USB-CDC driver, I was trying to find
> already developed, but I couldn?t find any.
>
> >
> > > I've met some problems with initializing the
> > device: Windows
> > > recognizes the device as another COM port, but
> > when I'm trying to
> > > open the port by the hyperterminal, I have message
> > "Could not open
> > > COM port". What would be the cause of such
> > behavior, below result of
> > > lsusb -vvv command on Linux (I can also send my
> > c-code of USB
> > > initialization if necessary).
> >
> > Do you have a trace of the USB messages sent
> > backwards and forwards
> > when the device is opened? Does your driver handle
> > all these messages?
>
> I didn?t try to sniff connection, today I?m going to
> install SnoopyPro and log trace of the connection. Can
> you recommend me similar software for Linux?
Take a look at linux-*/Documentation/usb/usbmon.txt
>
> >
> >
> > > Second question is, how to set
> > > Functional Descriptors like CDC Header, CDC ACM,
> > CDC Union, CDC Call
> > > Management? Are these parameters necessary for
> > proper operating the
> > > USB-CDC device?
> >
> > What does the standard say? Is there a standard? Is
> > this part of HID?
> >
> > What does Linux make of this device? Maybe you can
> > get better
> > diagnostics from Linux than from M$. At least with
> > Linux you have the
> > source code so you can find out why Linux does not
> > like your
> > driver....
>
> I don?t know if the standard of USB-CDC already
> exists.
You probably need to take a look at the USB website, www.usb.org.
Without having the standard you have no real idea what you are
supposed to be implementing.....
You might also want to look at drivers/usb/gadget/serial.c and the
associated documentation. However, since this code is GPL, you cannot
directly use it.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] USB-CDC eCos configuration
2007-08-27 20:01 ` Andrew Lunn
@ 2007-09-03 7:46 ` wavecom wavecom
0 siblings, 0 replies; 5+ messages in thread
From: wavecom wavecom @ 2007-09-03 7:46 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss
Hi All,
During development my USB-CDC driver, I have met
another com initialization problem. Symptoms are that
hyperterminal returns Âcannot initialize COMxÂ.
I have sniffed transmission between host and the
device. First two errors occurs in packet #12 (result
code 0xc0010000) and #13 (result code 0xc0000004).
00 20 00 00 00 00 07 00
data direction: host to device
type: standard
recipient: interface
req->request: Set line coding
21 20 00 00 00 00 07 00
data direction: host to device
type: class
recipient: interface
req->request: Set line coding
00 21 00 00 00 00 07 00
data direction: host to device
type: standard
recipient: interface
req->request: Set line coding
a1 21 00 00 00 00 07 00
data direction: host to device
type: class
recipient: interface
req->request: Set line coding
My question is what may be the cause of device replies
0xc0010000 and 0xc0000004?
I will be very grateful for any suggestions.
My driver has implementation of functions:
usbs_at91_ep0.standard_control_fn
usbs_at91_ep0.class_control_fn
usbs_at91_ep0.reserved_control_fn
functions returns USBS_CONTROL_RETURN_HANDLED
in operations
USB_SET_LINE_CODING 0x20
USB_GET_LINE_CODING 0x21
USB_SET_CONTROL_LINE_STATE 0x22 requests.
Below details of communication and all packet
sequence...
packets #12 and #13....
12 out down n/a 20.069 CLASS_INTERFACE 00 c2 01 00 01
00 08
URB Header (length: 80)
SequenceNumber: 12
Function: 001b (CLASS_INTERFACE)
PipeHandle: 851ac7e0
SetupPacket:
0000: 00 20 00 00 00 00 07 00
bmRequestType: 00
DIR: Host-To-Device
TYPE: Standard
RECIPIENT: Device
bRequest: 20
unknown!
TransferBuffer: 0x00000007 (7) length
0000: 00 c2 01 00 01 00 08
12 out up n/a 50.092 CONTROL_TRANSFER - 0xc0010000
URB Header (length: 80)
SequenceNumber: 12
Function: 0008 (CONTROL_TRANSFER)
PipeHandle: 851ac7e0
SetupPacket:
0000: 21 20 00 00 00 00 07 00
bmRequestType: 21
DIR: Host-To-Device
TYPE: Class
RECIPIENT: Interface
bRequest: 20
No TransferBuffer
13 out down n/a 50.092 CLASS_INTERFACE -
URB Header (length: 80)
SequenceNumber: 13
Function: 001b (CLASS_INTERFACE)
PipeHandle: 851ac7e0
SetupPacket:
0000: 00 21 00 00 00 00 07 00
bmRequestType: 00
DIR: Host-To-Device
TYPE: Standard
RECIPIENT: Device
bRequest: 21
unknown!
No TransferBuffer
13 in up n/a 50.112 CONTROL_TRANSFER 0xc0000004
URB Header (length: 80)
SequenceNumber: 13
Function: 0008 (CONTROL_TRANSFER)
PipeHandle: 851ac7e0
SetupPacket:
0000: a1 21 00 00 00 00 07 00
bmRequestType: a1
DIR: Device-To-Host
TYPE: Class
RECIPIENT: Interface
bRequest: 21
TransferBuffer: 0x00000000 (0) length
All transmission:
1 in down n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE
1 in up n/a 0.000 CONTROL_TRANSFER 12 01 10 01 02 00
00 08 0x00000000
2 in down n/a 0.000 GET_DESCRIPTOR_FROM_DEVICE
2 in up n/a 0.000 CONTROL_TRANSFER 09 02 43 00 02 01
00 c0 0x00000000
3 ??? down n/a 0.000 SELECT_CONFIGURATION
3 ??? up n/a 0.060 SELECT_CONFIGURATION 0x00000000
4 out down n/a 0.060 CLASS_INTERFACE -
4 in up n/a 0.060 CONTROL_TRANSFER 00 c2 01 00 01 00
08 0x00000000
5 out down n/a 0.060 CLASS_INTERFACE -
5 out up n/a 0.060 CONTROL_TRANSFER - 0x00000000
6 ??? down n/a 0.060 BULK_OR_INTERRUPT_TRANSFER -
7 ??? down n/a 0.060 BULK_OR_INTERRUPT_TRANSFER -
8 out down n/a 20.049 CLASS_INTERFACE -
8 in up n/a 20.049 CONTROL_TRANSFER 00 c2 01 00 01 00
08 0x00000000
9 out down n/a 20.049 CLASS_INTERFACE -
9 in up n/a 20.049 CONTROL_TRANSFER 00 c2 01 00 01 00
08 0x00000000
10 out down n/a 20.049 CLASS_INTERFACE -
10 in up n/a 20.049 CONTROL_TRANSFER 00 c2 01 00 01 00
08 0x00000000
11 out down n/a 20.069 CLASS_INTERFACE -
11 in up n/a 20.069 CONTROL_TRANSFER 00 c2 01 00 01 00
08 0x00000000
12 out down n/a 20.069 CLASS_INTERFACE 00 c2 01 00 01
00 08
12 out up n/a 50.092 CONTROL_TRANSFER - 0xc0010000
13 out down n/a 50.092 CLASS_INTERFACE -
13 in up n/a 50.112 CONTROL_TRANSFER 0xc0000004
14 out down n/a 50.112 CLASS_INTERFACE -
14 in up n/a 50.112 CONTROL_TRANSFER 0xc0000004
15 out down n/a 50.112 CLASS_INTERFACE -
15 in up n/a 50.112 CONTROL_TRANSFER 0xc0000004
16 out down n/a 50.112 CLASS_INTERFACE b0 04 00 00 01
00 08
16 out up n/a 50.112 CONTROL_TRANSFER - 0xc0000004
17 out down n/a 50.112 CLASS_INTERFACE -
17 in up n/a 50.112 CONTROL_TRANSFER 0xc0000004
18 out down n/a 50.112 CLASS_INTERFACE -
18 out up n/a 50.112 CONTROL_TRANSFER - 0xc0000004
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell.
http://searchmarketing.yahoo.com/
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-03 7:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-27 7:20 [ECOS] USB-CDC eCos configuration wavecom wavecom
2007-08-27 7:33 ` Andrew Lunn
2007-08-27 12:16 ` wavecom wavecom
2007-08-27 20:01 ` Andrew Lunn
2007-09-03 7:46 ` wavecom wavecom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).