cancel
Showing results for 
Search instead for 
Did you mean: 

USART2 works but other USARTS don't work. (STM32F446RE)

LCho.1
Associate II

Hello,

I am struggling to use multiple USARTs. I tested that USART2 works fine but I cannot get USART1 and USART3 to work.

If I can't use multiple USARTs at the same time, I would like to use only USART3. However, USART3 does not work. Do I need to change settings on the Windows to use different USART?

I am using STM32F446 nucleo board and using Putty to see serial port on windows.

Any help would be very appreciated!

Thank you

void SendInitString(void)
{
	uint8_t Test3[] = "Hello World 33 !!!\r\n"; //Data to send
	HAL_UART_Transmit(&huart3,Test3,sizeof(Test3),10);// Sending in normal mode
 
	uint8_t Test2[] = "Hello World 22 !!!\r\n"; //Data to send
	HAL_UART_Transmit(&huart2,Test2,sizeof(Test2),10);// Sending in normal mode
 
	uint8_t Test1[] = "Hello World 11 !!!\r\n"; //Data to send
	HAL_UART_Transmit(&huart1,Test1,sizeof(Test1),10);// Sending in normal mode
	HAL_Delay(1000);
}
 
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_USART3_UART_Init();
  MX_USART2_UART_Init();
  MX_USART1_UART_Init();
  /* USER CODE BEGIN 2 */
 
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
	  SendInitString();
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
 
  }
  /* USER CODE END 3 */
}

1 ACCEPTED SOLUTION

Accepted Solutions

@LCho.1​ "The solution was to connect tx and rx of usart3 to FTDI cable"

Not sure what you mean by that - please explain further?

Obviously, the ST-Link's VCP on the Nucleo board is hardwired to 2 pins on the STM32 - this is explained in the documentation, and you can see it in the schematics.

The VCP can only connect to one UART at a time.

So, if you want to use a different UART, you'd have to

  1. disconnect the original links
  2. add new links as required.

0693W000008y9fZQAQ.png

View solution in original post

2 REPLIES 2
LCho.1
Associate II

The solution was to connect tx and rx of usart3 to FTDI cable, not rely only on the usb cable connected to the nucleo board

@LCho.1​ "The solution was to connect tx and rx of usart3 to FTDI cable"

Not sure what you mean by that - please explain further?

Obviously, the ST-Link's VCP on the Nucleo board is hardwired to 2 pins on the STM32 - this is explained in the documentation, and you can see it in the schematics.

The VCP can only connect to one UART at a time.

So, if you want to use a different UART, you'd have to

  1. disconnect the original links
  2. add new links as required.

0693W000008y9fZQAQ.png