Hi there.
My name is Fonseca and I have some doubts about USB Real-Time library. Would anyone clear up my doubts please? I´ve a development kit based on LPC1857 microcontroller. This microcontroller has two USBs (both are available in my kit), and I want to use both as Device USBS, working as CDC (I mean, I want to use these two USBs as two Virtual COM Ports). I have spent some time reading and practicing about RL-USB library, and I coudn´t find a way to connect, disconnect, get data and put data in USBs individually, what seems that two USB management aren´t possible using RL-USB library. Is this true? If yes, is there another library for working with two USBs as Virtual COM ports?
Best Regards.
This is possible with the USB component from MDK-ARM V5 Middleware: http://www.keil.com/mdk5/middleware
Robert, first of all, thank you for the reply!
I read some fragments of USB section of MDK5, and I´ve got some doubts. Would you clear up my doubts please?
As I read in USB functions´ documentation (http://www.keil.com/pack/doc/mw/USB/html/group__usbd__cdc_functions.html#gae533b6ee1feb71d6210a31f1d83f94e8), these funcions are very similar to those are available in Real-Time Library. I mean, I´ve not seen a way to connect, disconnect, get data and put data to/from a specific USB port (working as USB Device CDC). For example, there´re no parameters in "USBD_CDCn_ACM_Initialize()", and the function description says: "The function USBD_CDCn_ACM_Initialize initializes the hardware resources of the port used as the Virtual COM Port.". I mean, it seems that, in this case, it isn´t possible to control, get and put data from specif USB.
Am I wrong? If yes, would you explain to me how can I manage individually the USB Device CDC (Virtual COM) please?
In document where point you states that possible multiple instance of given classes: The USB Device Class Parameters and Endpoint Settings are configured in separate files for each USB Device Class and separately for each instance. The configuration files contain Device Class specific Endpoint Settings Numbers and are listed in the Project Window under the Component USB. Another excerpt clearly states max 4 instances of CDC class: This documentation uses n as a placeholder for the instance number 0 - 3. Most applications only require one instance of a CDC class. For the first CDC class instance the instance number is 0:
I hope this help for you.
Georg
Take a look at existing VirtualCOM examples in device family packs found here: http://www.keil.com/dd2/pack/
There are a number of devices that have two USB ports and the following examples show how to use two USB Device CDC connections:
LPC1800 Device family pack \Pack\Keil\LPC1800_DFP\2.2.0\Boards\Keil\MCB1800\Middleware\USB\Device\VirtualCOM
LPC4300 Device family pack \Pack\Keil\LPC4300_DFP\2.2.2\Boards\Keil\MCB4300\Middleware\USB\Device\VirtualCOM
STM32F2 Device family pack \Pack\Keil\STM32F2xx_DFP\2.1.0\MDK\Boards\Keil\MCBSTM32F200\Middleware\USB\Device\VirtualCOM
STM32F4 Device family pack \Pack\Keil\STM32F4xx_DFP\2.3.0\MDK\Boards\Keil\MCBSTM32F400\Middleware\USB\Device\VirtualCOM
Robert and Georg, thank you very much!!