K28f example project dev_composite_cdc_vcom_cdc_vcom_bm can we instantiate more than two virtual COM ports?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K28f example project dev_composite_cdc_vcom_cdc_vcom_bm can we instantiate more than two virtual COM ports?

825 Views
aes_mike
Contributor III

Hello,

I am playing around with the demo project  "dev_composite_cdc_vcom_cdc_vcom_bm" with supports two virtual com ports via USB.  I am wondering how to change the code to support four vcoms?  

I am asking this question in part to better understand the project and it would just be interesting to see this work!

Seems to me that in the usb_device_descriptor.c file that there needs to be more configuration definitions for the "usb_device_class_struct_t g_UsbDeviceCdcVcomConfig[2] " structure, but seems like there might be other things need to be changed.

Admittedly, I am new to the USB stack and trying to gain some understanding. 

Thanks!

0 Kudos
4 Replies

617 Views
EE17
Contributor I

Hi,

I also have the same question.  I tried to follow Jing's recommendation but I cannot make it work.  With my modification, the original 2 virtual coms are not even recognized by the window.  After, I fashed/run my modified program, I can only see : "USB device composite demo" from the Console, and that is all.  My question: anyone successfully add extra Virtual com from the SDK2.5  composite_cdc_vcom_com_cdc_vcom_bm example?  Can you post your modified code? There are a lot of steps and it is easy to make a mistake.

Thanks.

0 Kudos

617 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

There are many files you should modify. They are in the source directory. The first thing you should change is define USB_DEVICE_CONFIG_CDC_ACM as 4. Then all the code relate to it should be checked carefully. Another important thing is USB descriptor in usb_device_descriptor.c. You must modify it very carefully. 

Here I can't list all the things you should take care. When you download the KSDK, there is a document package. There is a MCUXpresso SDK_USB_Stack_Composite_Device_User's_Guide.pdf. It can give you many help.

Regards,

Jing

0 Kudos

617 Views
aes_mike
Contributor III

I also need to add that I am using NXP MCUXpresso IDE v10.2.1 along with SDK 2.4.1  for the MK27FN2M0xxx15.

0 Kudos

617 Views
mjbcswitzerland
Specialist V

Hi Mike

Are you using the HS or FS USB interface?

The FS one has 16 endpoints and the HS one 8 so it is possible to make 7 USB-CDC interface (sharing an endpoint for each bulk CDC IN/OUT) or 5 when IN/OUT are on different endpoints on the FS OTG interface.

On the HS interface 3 or 2, respectively, are possible.

You need to check whether the USB stack is sharing endpoints or not to get its limits.

In case of complications the uTasker USB stack can also be used with MCUXpresso and SDK (links below) where the number of USB VCOMs is configured by a single define:

#define USB_CDC_VCOM_COUNT        4      // the number of CDC virtual COM ports in composite device

#define USB_SIMPLEX_ENDPOINTS            // share IN and OUT on a single endpoint (remove for independent IN/OUT endpoints)

and mixed with various other composite classes.

I think that the Freescale/NXP USB stack requires a certain amount of custom modification and fairly deep understanding to do it because the 2 x CDC case is more an example of what can be done than a generic solution.

Regards

Mark

USB Guide: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
Composite and multiple VCOM: http://www.utasker.com/kinetis/USB_Device.html
Complete Solutions and technical support for professional Kinetis developments: http://www.utasker.com/kinetis.html

0 Kudos