UART COM issue with f030r8
Hello,
I am trying to use UART HAL with the stm32-f030r8 connected to the PC through a USB-TTL module.
The configuration is given below :
- The F030R8 has JP1 OFF, JP6 ON, JP5 on E5V.
- The USB-TTL is :

- The code is :
/* Includes ------------------------------------------------------------------*/
#include "main.h"
uint8_t test[] = "hello";
UART_HandleTypeDef huart2;
int main(void)
{
HAL_Init();
SystemClock_Config();
__USART2_CLK_ENABLE();
__GPIOA_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.Pin = GPIO_PIN_2;
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
GPIO_InitStructure.Alternate = GPIO_AF1_USART2;
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
GPIO_InitStructure.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.Pin = GPIO_PIN_3;
GPIO_InitStructure.Mode = GPIO_MODE_AF_OD;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
huart2.Instance = USART2;
huart2.Init.BaudRate = 9600;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.Parity = UART_PARITY_NONE ;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.StopBits = UART_STOPBITS_1;
while (1){
HAL_UART_Transmit(&huart2,test,sizeof(test),HAL_MAX_DELAY);
HAL_Delay(1000);
}
}
Then, the putty configuration is 9600 baud, 8 data bits, 1 stop bits, no parity; no flow control.
But I can't see anything in the terminal...
Would you please have suggestions ?
Thanks for your help ! :)
