Skip to Content
Block descriptionsUSB CDCCubeMX Configuration for the given MCU Model

CubeMX Configuration for a Given MCU Model

The following section describes the CubeMX configuration required for USB CDC blocks within STM microcontrollers. Please note that these parameters serve as a configuration example and should be tailored to meet the requirements of your specific application.

General CubeMX Settings

In some of the settings presented below, either a Full Speed or High Speed configuration must be applied depending on the target data transmission speed.

No.NamePathSettingSetting DescriptionScreenshot
1Internal / External PhyPinout & Configuration > Connectivity > USB_OTG_FS/HS > Mode > Internal / External PhyDevice_OnlyConfigures Internal Phy or External Phy as Device_Only. Internal Phy utilizes the embedded hardware to handle USB communications, whereas External Phy interfaces with an external integrated circuit.USB Mode setting
2SpeedPinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > SpeedFull_Speed or High_SpeedConfigures the data transmission speed. Select Full_Speed for USB_FS and High_Speed for USB_HS.USB Speed setting
3Enable internal IP DMAPinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > Enable internal IP DMADisabledDisables the internal DMA engine for the USB peripheral interface.USB DMA setting
4Low powerPinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > Low powerDisabledDisables low-power mode operations for the USB peripheral interface.USB Low Power setting
5Use dedicated end point 1 interruptPinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > Use dedicated end point 1 interruptDisabledDisables the dedicated hardware interrupt service routine for endpoint 1.USB Endpoint 1 Interrupt setting
6VBUS SensingPinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > VBUS SensingDisabledDisables the hardware VBUS voltage monitoring and sensing feature.USB VBUS Sensing setting
7Signal start of framePinout & Configuration > Connectivity > USB_OTG_FS/HS > Parameter Settings > Parameter Setting > Signal start of frameDisabledDisables the Start of Frame (SOF) hardware signal output indicator feature.USB SOF setting
8USB OTG HS/FS Device Global InterruptPinout & Configuration > Connectivity > USB_OTG_FS/HS > NVIC Settings > USB OTG HS/FS Device Global InterruptEnabledEnables the global nested vectored interrupt controller (NVIC) line for the USB interface.USB Global Interrupt setting
9Class For HS/FS IPPinout & Configuration > Middleware and Software Packs > USB_DEVICE > Class For HS/FS IPCommunication Device Class (Virtual Port Com)Sets the USB device driver class implementation type to Communication Device Class (Virtual Port Com).USB Class setting
10USBD_LPM_ENABLED (Link Power Management)Pinout & Configuration > Middleware and Software Packs > USB_DEVICE > Parameter Settings > USBD_LPM_ENABLED0: Link Power Management not supportedDisables the Link Power Management (LPM) compliance framework for the USB subsystem.USB LPM setting
Last updated on