Associate III
August 27, 2026
Question
USB with STM32C071RBT6
- August 27, 2026
- 12 replies
- 100 views
I want progrma the STM32C071RBT6 for to get a virtual COM port.
I’m using NUCLEO-C071RB board and this are the settings with Cube MX:





I add some instructions into the main like this:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_CRC_Init();
MX_USB_PCD_Init();
MX_USBX_Device_Init();
_ux_dcd_stm32_initialize(0, (ULONG)&hpcd_USB_DRD_FS);
if (HAL_PCD_Start(&hpcd_USB_DRD_FS) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
_ux_device_stack_tasks_run();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}Now if i connect the USB cable to the PC, Windows recognizes the device and add a COM port. No issue for the operative system, the device works fine, but if i try to open that COM port with Putty or Real Term I immediately get a error.
Can anyone help me for understand what happen?
