2020-09-08 04:23 AM
Purpose: try to print "hello world" .
Status: VCP shown in Device Manager as COM3. Putty can connect. Nothing displayed, tried other serial port debug tool. No success.
simple code, except HAL_UART_Transmit, all others are auto-generated by CubeIDE. UART2 is supposed to connect to ST_LINK directly by default and then the Host. Any idea?
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_TIM17_Init();
/* USER CODE BEGIN 2 */
HAL_TIM_PWM_Start_IT(&htim17,TIM_CHANNEL_1);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_Delay(200);
HAL_UART_Transmit(&huart2,data,sizeof(data),0xFFFF);
}
/* USER CODE END 3 */
}
2020-09-08 05:35 AM
Check that the pins are initialized correctly. Check clock settings. The issue is probably one of those two things.