UART2 VCP L432KC
while (1)
{
/* USER CODE END WHILE */
if (HAL_UART_Receive(&huart2, data, 10, 100) == HAL_OK) {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1);
HAL_Delay(200);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0);
HAL_Delay(200);
}
/* USER CODE BEGIN 3 */
}
This is my code to check if I am sending any data from Putty/Realterm/Docklight to UART2 and then blinking the in built LED. What are some reasons this might not be working? I tried this in interrupt mode as well.
