Datasheet

Table 10. Line Coding Structure (continued)
1: Odd 4: Space
2: Even
6 bDataBits 1 Data bits (5,6,7,8 or 16)
SetLineCoding is an output class request, which corresponds to GetLineCoding. The USB host uses this command to set the
serial port property of the device, and its data structure is the same as GetLineCoding. After the USB host completes these
standard requests and class requests, the enumeration process ends, and the USB host will recognize multiple VCOMs. Then
the serial port debugging terminal on the PC can communicate with the USB device of the K32L2 series MCU.
6 Key Steps
6.1 How to expand the number of supported VCOMs
This section uses the SDK code
dev_composite_cdc_vcom_cdc_vcom_lite_bm
as an example to show how to extend to three
VCOMs based on two VCOMs. The specific steps are as follows:
1. Modify the usb_device_config.h file
Change the value of the macro USB_DEVICE_CONFIG_CDC_ACM from 2 to 3
#define USB_DEVICE_CONFIG_CDC_ACM (2U) to
#define USB_DEVICE_CONFIG_CDC_ACM (3U)
Modify the value of the USB_DEVICE_CONFIG_ENDPOINTS macro
#define USB_DEVICE_CONFIG_ENDPOINTS (5U) to
/* Values that meet functional requirements are ok */
#define USB_DEVICE_CONFIG_ENDPOINTS (8U)
2. Modify the usb_device_descriptor.h file
Change the value of the macro USB_INTERFACE_COUNT from 4 to 6
#define USB_INTERFACE_COUNT (4) to
#define USB_INTERFACE_COUNT (6)
Add some macro definitions for VCOM3
#define USB_CDC_VCOM_INTERFACE_COUNT_3 (2)
#define USB_CDC_VCOM_CIC_INTERFACE_INDEX_3 (4)
#define USB_CDC_VCOM_DIC_INTERFACE_INDEX_3 (5)
/* If the CDC interface does not require an Interrupt IN endpoint, then this macro is 0 */
#define USB_CDC_VCOM_CIC_ENDPOINT_COUNT_3 (1)
/* If the CDC interface does not require an Interrupt IN endpoint, you do not need to define
this macro*/
#define USB_CDC_VCOM_CIC_INTERRUPT_IN_ENDPOINT_3 (7)
#define USB_CDC_VCOM_DIC_ENDPOINT_COUNT_3 (2)
#define USB_CDC_VCOM_DIC_BULK_IN_ENDPOINT_3 (3)
#define USB_CDC_VCOM_DIC_BULK_OUT_ENDPOINT_3 (3)
#define HS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE_3 (16)
#define FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE_3 (16)
NXP Semiconductors
Key Steps
USB to Multi VCOM on K32L2 Series MCU, Rev. 0, November 2019
Application Note 15 / 25