Datasheet

1 Introduction
This application note describes how to implement a USB to multiple VCOMs'
functions on K32L2 series FRDM boards (FRDM-K32L2B3/FRDM-K32L2A).
The function of USB to VCOM can be implemented by using the common AT
commands in the subclass of the abstract control model in the CDC class
specified by the USB protocol. A USB device can support one or more VCOMs,
the number of VCOM depends mainly on the number of endpoints (EP)
supported by USB device. The Full-speed (FS) USB device controller for
K32L2 series MCU supports 16 bidirectional endpoints and supports up to 15
VCOMs. Based on the SDK code
(dev_composite_cdc_vcom_cdc_vcom_lite_bm), this application note
implements the function of a USB to 15 VCOMs and the development tool is
MCUXpresso IDE.
2 USB descriptor configuration
The USB descriptor is equivalent to the business card of the USB device, and
describes all the attributes and configurable information of the USB device,
such as the class, interface information, and endpoint information. If the
descriptor of the device is obtained, the type, purpose, and the parameters of
the communication of the device, etc. are known, and the USB host can
configure it so that both parties of the communication work with the same
parameters.
The function of a USB to multiple VCOMs can be implemented by using the USB Composite class. The Composite class is a
special USB class that can implement multiple different functions in a USB device. Such as a device can implement “Mouse +
Keyboard” function, or “VCOM + Keyboard” function. In fact, the USB Composite class can implement almost any combination
of USB functions, and it is not just a combination of two functions, it can be three or more, so you can use the composite class
to implement the functions of two CDCs or multiple CDCs.
A CDC class device consists of two subclass interfaces: a CDC class interface and a data class interface. A CDC device can
contain zero or more data interfaces.
The CDC class interface uses a standard interface descriptor that requires a control endpoint and an optional interrupt IN
endpoint.
The data class interface requires a Bulk IN and a Bulk OUT type of endpoint. But since the 16 endpoints on the K32L2B3/
K32L2A are bidirectional endpoints, an endpoint can implement both input and output functions, ie the functions of Bulk IN
and Bulk OUT can be implemented by one endpoint.
In order to support more VCOM, the interrupt IN endpoint in CDC class interface can be removed, so that in addition to a common
control endpoint only one bidirectional endpoint is needed to implement a VCOM. That is, except that EP0 is used as the control
endpoint, the other 15 endpoints can implement 15 VCOMs and this application note implement such a feature. The descriptor
structure of the composite class containing 15 CDC subclasses used in this application note is shown in Figure 1.
Contents
1 Introduction............................................ 1
2 USB descriptor configuration................. 1
3 Endpoint usage......................................2
4 Endpoint Buffer Configuration................4
4.1 Buffer Descriptor Table...........4
4.2 Endpoint Buffer....................... 6
5 Software workflow chart.........................8
5.1 USB interrupt service
function flowchart.................. 11
5.2 USB device request.............. 13
6 Key Steps............................................ 15
6.1 How to expand the number
of supported VCOMs.............15
6.2 How to remove the
Interrupt IN endpoint in the
CDC interface........................16
6.3 Code optimization................. 18
7 Function Test....................................... 23
8 Conclusion........................................... 24
9 References.......................................... 24
AN12597
USB to Multi VCOM on K32L2 Series MCU
Rev. 0 — November 2019
Application Note

Summary of content (25 pages)