Skip to main content
Associate
Sep 28, 2026 4:17 PM UTC
Question

STM32C55 USB virtual com port issue.

Hello everyone. 

Hi everyone.
Please forgive any inaccuracies in this post—it’s my first one.

For my new project, I used the STM32C552KET6 microcontroller.
The chip is mounted on a custom PCB I designed.
One of the board's functions is to communicate with a PC via a virtual COM port (over USB).
I’ve successfully used this type of communication in other projects before on G4, L4 microcotrolers, but this time I can't get it working and have no idea where I might be making a mistake.
The electrical connections are definitely correct; I can connect to the microcontroller using STM32CubeProgrammer and read/write to Flash memory via USB.
I used the STM32CubeMX2 tool (version 1.1.1) for configuration.
The clock configuration is default, and the USB clock frequency is 48 MHz.
In the Connectivity section, I selected: USB_DRD_FS – DEVICE (device mode); all advanced features are disabled; the USB_DP and USB_DM pins are assigned to PA12 and PA11, respectively.
Global interrupts and IRQ handling are enabled.
I activated the USBX middleware and enabled the CDC ACM class with default settings.
In the Interfaces → Logical interface section, I enabled the device controller.
In the HW resources allocation section, I selected the USB_DRD_FS.DEVICE instance. 
I increased the system stack size from 512 to 8192.
After creating the project and programming the microcontroller, the computer does not detect any new device.

I searched online and found information indicating that the `app_usbx_init()` function should be used and that `app_usbx_process()` should be called within the main loop.
After implementing these functions in the project, the computer began detecting the device but reports an error: "USB device returned an invalid device descriptor – error code 43".
I use PC with system Windows 11 Pro.

I can't fix it. 
Can you help me. 

6 replies

Pavel A.
Sep 28, 2026 9:30 PM UTC

Unfortunately the CubeMX* generator does not always produce a 100% working project, and manual fixes are error prone.

The fastest self-help is to start from a ready example like this: 

 https://github.com/STMicroelectronics/STM32CubeC5/tree/main/examples/middleware/usbx/device_cdc_acm_uart_freertos

Adapt it to your board pinout. Then carefully compare how the USB setup differs from code generated by Cube.

The next option is to get a helping hand.

 

Andrew Neil
Super User
Sep 29, 2026 9:08 AM UTC

The fastest self-help is to start from a ready example like this: 

 https://github.com/STMicroelectronics/STM32CubeC5/tree/main/examples/middleware/usbx/device_cdc_acm_uart_freertos

Adapt it to your board pinout.

 

Absolutely - especially as a first project!

 

​@Paweł_k - avoid the “Adapt it to your board pinout” step by first getting it working on Nucleo board.

That will give you a known-good reference, against which you can compare & contrast your custom board.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
T_Hamdi
ST Employee
Sep 30, 2026 10:23 AM UTC

hello ​@Paweł_k 

Welcome to the ST Community Platform.

Please refer to this application for help identifying your mistake.

STM32CubeC5/examples/middleware/usbx/device_cdc_acm_uart_freertos at main · STMicroelectronics/STM32CubeC5 · GitHub .

If you still encounter any problem, please provide more details about your application.

Also, you may find the following document helpful for using USBX: USBX user guide - USBX 2.1.0 documentation

with regards,

Hamdi

 

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Hamdi Teyeb"
Uwe Bonnes
Chief
Oct 2, 2026 12:41 PM UTC

For a hardware test, boot to the system bootloader and look if your board enumarates as DFU

Paweł_kAuthor
Associate
Nov 1, 2026 1:27 PM UTC

Hello Everyone. 

I followed your suggestions and compared the settings with those found in the example at: STM32CubeC5/examples/middleware/usbx/device_cdc_acm_uart_freertos at main · STMicroelectronics/STM32CubeC5 · GitHub.

When using USBX, CubeMX2 does not correctly configure the "System stack size" or the "Packet memory area" for endpoints.

I adjusted these settings to match the example, and everything started working properly.
Thanks again for your help—talk to you later!

 

ST Technical Moderator
Nov 11, 2026 4:47 PM UTC

Hi ​@Paweł_k 

Thank you for your feedback !

Could you clarify what you mean by CubeMX2 not correctly configuring the PMA and system stack size? Code generation works in my setup, but the generated PMA start address may be incorrect in some configurations. This is planned to be addressed in a future release.

Regarding the system stack, USBX projects use a default of 512 bytes. This is a default value, not a guarantee that it will be sufficient; adjust it to suit your application and verify stack usage. 

An internal ticket CDM0067410  has been submitted to the dedicated team to request increase of the default to 1 KB. ( internal reference for ST employees and not for users)

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL