Skip to main content
gh_rcl
Associate II
April 28, 2021
Question

STM32G071C8T6 and USART3

Hi All,

I don't managed to send char on USART3 with the attached project.

I was wondering if someone had already detected issue in using USART3

Thanks in advance

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
April 28, 2021

Where in the code are you transmitting and how?

What hardware are you using? Did you observe the Tx pin using oscilloscope?

Read out and check/post the relevant USART and GPIO registers content.

JW

TDK
April 30, 2021

Your code doesn't attempt to send anything. It initializes the peripheral but never uses it.

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_USART3_UART_Init();
 /* USER CODE BEGIN 2 */
 
 /* USER CODE END 2 */
 
 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 
 /* USER CODE BEGIN 3 */
 }

Lots of examples out there to follow:

https://github.com/STMicroelectronics/STM32CubeG0/blob/5cb06333a6a43cefbe145f10a5aa98d3cc4cffee/Projects/NUCLEO-G071RB/Examples/UART/UART_TwoBoards_ComPolling/Src/main.c

"If you feel a post has answered your question, please click ""Accept as Solution""."
gh_rcl
gh_rclAuthor
Associate II
May 5, 2021

Hello,

Thanks for your feedback.

Indeed i attached the wrong file.

Anyway i found the issue. Indeed by setting Tx and Rx as output, i noticed that only Rx was OK.

By testing with another board it works.

Thanks again for your time.

gh_rcl