LPCopen usbd lib and several instances of a CDC device

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPCopen usbd lib and several instances of a CDC device

815件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wilmer00 on Tue Feb 10 07:26:22 MST 2015
Hi,

I have modified the lpcexpresso usbd cdc example to provide more than CDC interface (5).

The devices enumerate nicely and I see

USBD_API->core->RegisterEpHandler(hUsb, ep_indx, com->pInHdlr, com);

is returning ok -where I give the correct index and the same handler for each comport - I also tried to give different handler functions.

The endpoint  handler is called only from the first interface. And I can receive/send data through the first interface - obviously I wan to use more than one interface.

Has someone an idea, if the usbd Library is supposed to be able to handle multiple instances of a CDC interface?

Though LPCOpen is advertising to be open source, the usbd library is not available in source code, so I could debug myself.

Plan B, I catch the Interrupt myself and process the other Endpoints directly.

Any good advice?

Thank you.
ラベル(1)
0 件の賞賛
返信
4 返答(返信)

725件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wilmer00 on Fri Feb 20 09:19:44 MST 2015
Hi
I got it working...

The reason was that I didn't take into account that the endpoints only support certain types. A isochronous endpoint can't be a bulk or interrupt endpoint...

Very subtile bug, it would be nice to have a separate error code for this...

Kidn Regards
0 件の賞賛
返信

725件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mch0 on Wed Feb 18 13:23:30 MST 2015
Hi Wilmer,

some time ago I defined a dual CDC device sucessfully on another uC (not NXP).
At that time I used IADs (Interface Association Descriptors) to help MS Windows to enumerate the individual interfaces correctly.
If you did no use IADs within the config. decriptor that might be a problem with MS.
I could post the descriptors I used back then.

Of course the controller you use must provide enough endpoints of the correct type in hardware as well.
I did use 3 logical EPs for each CDC (1 INT IN, 1 BULK IN, 1 BULK OUT).
5 CDC interfaces might exceed the capabilities of the USB HW.
I did not check whether the standard allows the INT IN EPs to be shared, i.e. the same for all data class interfaces. I used separate ones.

Best regards,

Mike
0 件の賞賛
返信

725件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by djbuijs on Sun Feb 15 02:12:55 MST 2015
Hm, it seems that you cannot post hyperlinks on this forum. If you google "microchip 189607" You'll end up with a microchip forum post which talks exactly about multiple interfaces in a CDC device.

Good luck!
Dirk
0 件の賞賛
返信

725件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by djbuijs on Sun Feb 15 00:25:11 MST 2015
Hi Wilmer,
I don't have a proper answer for you on what approach is best, but I did find a link which might help you: checkout "micropendousx"

Checkout the files here:"MicropendousX\Firmware\LPC17xx\FreeRTOS_USBSerial_Ethernet_LPC17x8\LPCUSB".

Other examples can be found in the CooCox IDE distribution. The file you'll be interested in is located here: CooCox\CoIDE\repo\Components\278_USB CDC LPC17xx\src\USB_Stack\usbhw.c

You'll have to be into nested switch statements to be able to read that code though.... (You'll see what I mean :))

I am working on a VCP implementation myself and have been trying to find a good example for NXP (LPC1788) when I stumbled on these links. We're using the UEZ framework, which has a basic driver for GenericBulk, but no VCOM implementation (at least not one they open-sourced).

Let me know what you find, I'll be very interested to see how you'll solve this.

Cheers,
Dirk
0 件の賞賛
返信