2026-05-05 12:14 AM - last edited on 2026-05-05 1:01 AM by Imen.D
Hi everyone,
I’d like to ask for your expertise. I’m working with a custom board based on the STM32H755ZIT, configured in LDO mode. My issue is that when I connect the board to my PC via USB to use the Virtual COM Port (VCP), the computer does not detect the device.
I haven’t encountered this problem on other boards I’ve used, such as those with STM32L4 or STM32WB, where USB VCP works as expected.
Is there a particular difference in the USB VCP implementation between the STM32H7 series and the STM32L4/WB series that I should be aware of?
Here is the noteworthy configuration of my project in CubeMX
For the code:
usbd_cdc_if.c
/* USER CODE BEGIN PRIVATE_VARIABLES */
USBD_CDC_LineCodingTypeDef LineCoding = {
115200, /* baud rate */
0x00, /* stop bits - 1 */
0x00, /* parity - none */
0x08 /* nb. of bits 8 */
};
/* USER CODE END PRIVATE_VARIABLES */
---
// icopied this code base on various example i encountered
static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length){
...
case CDC_SET_LINE_CODING:
LineCoding.bitrate = (uint32_t) (pbuf[0] | (pbuf[1] << 8) | (pbuf[2] << 16) | (pbuf[3] << 24));
LineCoding.format = pbuf[4];
LineCoding.paritytype = pbuf[5];
LineCoding.datatype = pbuf[6];
break;
case CDC_GET_LINE_CODING:
pbuf[0] = (uint8_t) (LineCoding.bitrate);
pbuf[1] = (uint8_t) (LineCoding.bitrate >> 8);
pbuf[2] = (uint8_t) (LineCoding.bitrate >> 16);
pbuf[3] = (uint8_t) (LineCoding.bitrate >> 24);
pbuf[4] = LineCoding.format;
pbuf[5] = LineCoding.paritytype;
pbuf[6] = LineCoding.datatype;
break;
...
on main.c
/* USER CODE BEGIN Includes */
#include "usbd_cdc_if.h"
/* USER CODE END Includes */
int main(void){
...
char xxx[10] = "Hello\r\n";
while (1){
CDC_Transmit_FS((uint8_t *)xxx, 7);
HAL_Delay(1000);
}
...
While browsing the STM32 firmware package, I came across the CDC_Stand_Alone example. I’d like to implement USB VCP on my custom board with the STM32H755ZIT, but I’m unsure how to port this example into my existing project since the structure differs quite a lot.
Any help would be appreciated.
IAN
2026-05-05 2:27 AM
Hi @ICMosquera
We have some architectural differences between the USB implementations on STM32WB / STM32L4 and STM32H7.
On STM32WB and STM32L4, the USB FS device implementation uses a USB FS controller, while on STM32H7 the USB OTG FS/HS controller is used.
Also, on H7, the USB clock is typically derived from a PLL generated clock. On L4, USB clock relies on the internal HSI48 oscillator.
Thanks for your feedback highlighting that the MX generated code structure is quite different from the example firmware provided. Well noted.
To narrow down the issue, could you please attach a minimal firmware project reproducing the problem?
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.
2026-05-05 6:16 PM
Hi FBL,
I’ve attached the bare‑minimum project file for reference. The power configuration is set to LDO Only with Scale 2. I enabled only the H7 core, and within it, just the USB.
After generating the code and loading it onto my board, my PC still fails to detect the device. Could you advise on what might be missing or misconfigured?
Regards,
Ian