Configuration of the USB Device CDC (ACM) Class.
Configuration of the USB Device CDC (ACM) Class.
This configuration file defines:
- The assignment of the CDC class to the USB Device instance.
- USB Endpoint assignments for the CDC class with parameters for Full/Low-speed and High-speed communication.
- Class Settings for the Interface Descriptor.
These settings are used to create the Interface Descriptor and Endpoint Descriptor of the related USB Device Class. It is important that the settings match the application specific behavior in the related C source file USBD_User_CDC_ACM_n.c.
CDC Class Configuration File
The USB Device CDC Class configuration file USBD_Config_CDC_n.h contains the following settings:
- Assign Device Class to USB Device # selects USB Device that is used for this Device Class instance.
- Communication Class Subclass specifies the model used by the CDC class. Select the
Abstract Control Model (ACM)
.
- Communication Class Protocol specifies the protocol used by the CDC class. For Virtual COM device select the
No protocol (Virtual COM)
, and for RNDIS device select the Vendor-specific (RNDIS)
.
- Interrupt Endpoint Settings
- Interrupt IN Endpoint Number sets the number of the endpoint to be used. Conflicting settings are flagged by compile-time error messages.
- Endpoint Settings
- Full/Low-speed (High-speed disabled): These parameters apply when High-speed is disabled in USBD_Config_n.h:
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange.
- Endpoint polling Interval (in ms) specifies the frequency of requests initiated by USB Host for getting a notification.
- High-speed: These parameters apply when High-speed is enabled in USBD_Config_n.h:
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange.
- Additional transactions per microframe specifies additional transactions per microframe.
- Endpoint polling Interval (in 125 us intervals) specifies the frequency of requests initiated by USB Host for getting a notification.
- Bulk Endpoint Settings
- Bulk IN Endpoint Number sets the number of the endpoint to be used. Conflicting settings are flagged by compile-time error messages.
- Bulk OUT Endpoint Number sets the number of the endpoint to be used. Conflicting settings are flagged by compile-time error messages.
- Endpoint Settings
- Full/Low-speed (High-speed disabled): These parameters apply when High-speed is disabled in USBD_Config_n.h:
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange.
- High-speed: These parameters apply when High-speed is enabled in USBD_Config_n.h:
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange.
- Maximum NAK Rate specifies the interval in which Bulk Endpoint can NAK.
- Communication Class Settings
- Communication Class Interface String is used to create USB Descriptors.
- Data Class Interface String is used to create USB Descriptors.
- Abstract Control Model Settings
- Call Management Capabilities settings are used to create Call Management Functional Descriptor:
- Call Management channel is used to specify channel of exchanging call management commands. Select required option, for Virtual COM device typically this is set to
Communication and Data Class Interface
, and for RNDIS device this is typically set to Communication Class Interface only
.
- Device Call Management handling is used to specify level of handling of call management by device. Select required option, for VirtualCOM device typically this is set to
All
, and for RNDIS device this is typically set to None
.
- Abstract Control Management Capabilities settings are used to create Abstract Control Management Functional Descriptor:
- D3 bit is used to specify if device supports the notification NetworkConnection. Select required option, typically this is
disabled
for both Virtual COM and RNDIS device.
- D2 bit is used to specify if device supports the request SendBreak. Select required option, for VirtualCOM device this is typically
enabled
and for RNDIS device this is typically disabled
.
- D1 bit is used to specify if device supports the following requests: SetLineCoding, GetLineCoding, SetControlLineState, and notification SerialState. Select required option, for Virtual COM device this is typically
enabled
and for RNDIS device this is typically disabled
.
- D0 bit is used to specify if device supports the following requests: SetCommFeature, ClearCommFeature and GetCommFeature. Select required option, for Virtual COM device this is typically
enabled
and for RNDIS device this is typically disabled
.
- Maximum Communication Device Send Buffer Size is used for memory allocation in the USB component.
- Maximum Communication Device Receive Buffer Size is used for memory allocation in the USB component.
- Network Control Model Settings are only valid for the Network Control Model sub-class.
- OS Resources Settings
- Communication Device Class Interrupt Endpoint Thread Stack Size is used for memory allocation in the USB component.
- The default Communication Device Class Interrupt Endpoint Thread priority is osPriorityAboveNormal. This priority can be changed by changing USBD_CDCn_INT_THREAD_PRIORITY define in this configuration file. This priority needs to be high enough so that USB Stack can react to USB events in a timely manner. Due to this requirement it is recommended to keep this setting at default.
- Communication Device Class Bulk Endpoints Thread Stack Size is used for memory allocation in the USB component.
- The default Communication Device Class Bulk Endpoints Thread priority is osPriorityAboveNormal. This priority can be changed by changing USBD_CDCn_BULK_THREAD_PRIORITY define in this configuration file. This priority needs to be high enough so that USB Stack can react to USB events in a timely manner. Due to this requirement it is recommended to keep this setting at default.