Datasheet
#define HS_CDC_VCOM_INTERRUPT_IN_INTERVAL_3 (0x07)
#define FS_CDC_VCOM_INTERRUPT_IN_INTERVAL_3 (0x08)
#define HS_CDC_VCOM_BULK_IN_PACKET_SIZE_3 (512)
#define FS_CDC_VCOM_BULK_IN_PACKET_SIZE_3 (64)
#define HS_CDC_VCOM_BULK_OUT_PACKET_SIZE_3 (512)
#define FS_CDC_VCOM_BULK_OUT_PACKET_SIZE_3 (64)
3. Modify the usb_device_descriptor.c file
• Modify the g_interface array
uint8_t g_interface[USB_CDC_VCOM_INTERFACE_COUNT + USB_CDC_VCOM_INTERFACE_COUNT_2
+ USB_CDC_VCOM_INTERFACE_COUNT_3];
• Modify the configuration descriptor array g_UsbDeviceConfigurationDescriptor: add the interface descriptor and
endpoint descriptor of CDC3. Refer to the attached code for details.
4. Modify the virtual_com.c file
• Extend s_lineCoding, s_abstractState, s_countryCode, s_usbCdcAcmInfo array.
• Modify the USB_DeviceCdcVcomSetConfigure() function to increase the initialization of non-control endpoint in CDC3.
The callback functions of the non-control endpoint in multi VCOMs are same in this application note. If you want
to modify the function of the application layer, you can use the callback function of different functions here.
NOTE
6.2 How to remove the Interrupt IN endpoint in the CDC interface
In order to enable the USB device to support more VCOM, the Interrupt IN endpoint in the CDC interface can be removed. The
specific implementation steps are as follows:
1. Modify the usb_device_config.h file
• Increase the definition of the macro USB_CDC_CIC_INTERRUPT_IN_ENDPOINT_ENABLE
#define USB_CDC_CIC_INTERRUPT_IN_ENDPOINT_ENABLE (0U)
2. Modify the usb_device_descriptor.h file
• Modify the value of the macro USB_CDC_VCOM_CIC_ENDPOINT_COUNT to 0
#define USB_CDC_VCOM_CIC_ENDPOINT_COUNT ( 0 )
And mask the definition of the Interrupt IN endpoint in the CDC interface according to the value of the
USB_CDC_CIC_INTERRUPT_IN_ENDPOINT_ENABLE macro.
#if USB_CDC_CIC_INTERRUPT_IN_ENDPOINT_ENABLE
/* No need interrupt IN endpoint for CIC interface */
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_2 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_3 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_4 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_5 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_6 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_7 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_8 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_9 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_10 (0)
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_11 (0)
NXP Semiconductors
Key Steps
USB to Multi VCOM on K32L2 Series MCU, Rev. 0, November 2019
Application Note 16 / 25