UART/USART Does not Work
I would like to transmit data via USART and read the data sent to computer via a terminal(I have tried Putty and Real Term so far). To that end, I activate
My USART configuration is seen as above. I also wrote the code below:
uint8_t myTxData[13] = "Hello World\r\n";
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_StatusTypeDef res = HAL_UART_Transmit(&huart1, myTxData, 13, 10);
if(!res) {
HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1);
HAL_Delay(1000);
}
}Note that I only put here inside the while loop. The other statements were generated by CubeMX.
Normally my code sends data to my pc if res is true, in other words, if it is HAL_OK, and also toggles the LED. Since it couldn't see the data in the terminal, I changed the condition in if statement, and saw that the led is toggled in each second. Therefore, I concluded that my USART channel does not work. What's the issue?
Thx for your help in advance.
