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.
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.
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