Static Stack Configuration
- 1 Core Configuration
- 2 Classes Configuration
- 2.1 Audio Class Configuration
- 2.2 Communication Device Class Configuration
- 2.3 Communication Device Class Ethernet Emulation Model Subclass Configuration
- 2.4 Human Interface Device Class Configuration
- 2.5 Mass Storage Class Configuration
- 2.6 Personal Healthcare Device Class Configuration
- 2.7 Vendor Class Configuration
µC/USB-Device is configurable at compile time via approximately 20 #defines in the application’s copy of usbd_cfg.h. µC/USB-Device uses #defines when possible, because they allow code and data sizes to be scaled at compile time based on enabled features and the configured number of USB objects. This allows the Read-Only Memory (ROM) and Random-Access Memory (RAM) footprints of µC/USB-Device to be adjusted based on application requirements.
It is recommended that the configuration process begins with the default configuration values which in the next sections will be shown in bold.
The sections in this chapter are organized following the order in µC/USB-Device’s template configuration file, usbd_cfg.h.
Core Configuration
Generic Configuration
Constant | Description | Possible values |
|---|---|---|
| Optimizes for either better performance or for smallest code size. Enabling this define will optimize µC/USB-Device code for better performance and disabling this define will lead to smaller code size. | |
| Configures the maximum number of devices. This value should be set to the number of device controllers used on your platform. | Default value is 1. |
| Configures the alignment in octets that internal stack’s buffer needs. This value should be set in function of your platform/hardware requirements. If your platform does not require buffer alignment, this should be set to the size of a CPU word ( | Typically 1, 2, 4 or 8. Default value is sizeof(CPU_ALIGN). |
| Allows code to be generated to check arguments for functions that can be called by the user and, for functions which are internal but receive arguments from an API that the user can call. | |
| Enables or disables support of Microsoft OS descriptors. Enabling this feature will cause the device to respond to Microsoft OS string descriptor requests and Microsoft OS specific descriptors. |
|
USB Device Configuration
Constant | Description | Possible Values |
|---|---|---|
| Sets the maximum number of USB configurations used by your device. Keep in mind that if you use a high-speed USB device controller, you will need at least two USB configurations, one for low and full-speed and another for high-speed. Refer to the Universal Serial Bus specification, Revision 2.0, section 9.2.3 for more details on USB configuration. | From 1 (low- or full-speed) or 2 (high-speed) to 254. Default value is 2. |
| Selected portions of μC/USB-Device code required only for isochronous transfers may be disabled to reduce the code size by configuring | |
| Selected portions of μC/USB-Device code required only for high-speed operation may be disabled to reduce the code size by configuring | |
| Sets the timeout in milliseconds for the Data and the Status phases of a control transfer. This timeout prevent from a deadlock situation during a control transfer processing by the core layer. Thus a value of 0, meaning wait forever, is not allowed. | From 1 to 65535. Default value is 5000. |
Interface Configuration
Constant | Description | Possible Values |
|---|---|---|
| Configures the maximum number of interfaces available. This value should at least be equal to | From 1 to 254. Default value is 2. |
| Defines the maximum number of alternate interfaces (alternate settings) available. This value should at least be equal to | From 1 to 254. Default value is 2. |
| Defines the maximum number of interface groups or associations available. For the moment, Micrium offers only one USB class (CDC-ACM) that requires interface groups. Refer to the Interface Association Descriptors USB Engineering Change Notice for more details about interface associations. | From 0 to 254. Default value is 0 (should be equal to the number of instances of CDC-ACM). |
| Defines the maximum number of endpoint descriptors available. This value greatly depends on the USB class(es) used. For information on how many endpoints are needed for each class, refer to the class specific chapter. Keep in mind that control endpoints do not need any endpoint descriptors. | From 0 to 254. Default value is 2. |
| Configures the maximum number of opened endpoints per device. If you use more than one device, set this value to the worst case. This value greatly depends on the USB class(es) used. For information on how many endpoints are needed for each class, refer to the class specific chapter. | From 2 to 32. Default value is 4 (2 control plus 2 other endpoints). |
| Defines the number of additional URBs that are used for asynchronous transfers only. Since these URBs are shared between every endpoint, if one endpoint uses them all, other endpoints will not be able to queue any transfer, although it is guaranteed that every endpoint always has one URB still available, to ensure that a transfer can be done at any time. | From 0 to (65535 - |
String Configuration
Constant | Description | Possible Values |
|---|---|---|
| Configures the maximum number of string descriptors supported. This value can be increased if, for example, you plan to add interface specific strings. | From 1 to 254. Default value is 3 (1 descriptor for Manufacturer string, Product string and Serial Number string). |
Debug Configuration
Configurations in this section only need to be set if you use the core debugging service. For more information on that service, see the Debug and Trace page.
Constant | Description | Possible Values |
|
|---|---|---|---|
| Enables or disables the core debug trace engine. |
|
|
| Defines the maximum number of debug trace events that can be queued by the core debug trace engine. This configuration constant has no effect and will not allocate any memory if | From 1 to 65535. Default value is 10. |
|
Classes Configuration
Audio Class Configuration
Communication Device Class Configuration
CDC Abstract Control Model Serial Class Configuration
Communication Device Class Ethernet Emulation Model Subclass Configuration
Human Interface Device Class Configuration
Mass Storage Class Configuration
Personal Healthcare Device Class Configuration
Vendor Class Configuration