cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 NUCLEO-H743ZI2 UART Baud rate mismatch problem

Chaotic
Associate II

Currently i am working with nucleo-h743zi2 board. I set the Baud rate in CubeMx to 115200. In the Hercules program, when I set the baud rate to 115200, the data does not flow correctly, but when I set the baud rate to 38400, it flows correctly. Why might this problem occur? My CubeMx settings can also be seen in the photo.

uart.PNG

7 REPLIES 7
SofLit
ST Employee

Hello,

Could you please share a minimal project that reproducers the issue?

Are you using USART3 and STLINK Virtual comport?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Chaotic
Associate II

I solved the problem. I was using HSE as clock. When I looked at the UART documentation for this card, I saw that clocks such as HSI, LSE should be used instead of HSE. Indeed, when I changed the HSE, the problem disappeared and communication took place smoothly with the same baudrate on the transmitter and receiver sides. If anyone knows a way to use HSE here, please let me know.

Hello,


When I looked at the UART documentation for this card, I saw that clocks such as HSI, LSE should be used instead of HSE. 

Where did you find this information? could you please share screenshot of that? because this doesn't make sense!

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

You can find it in the document in ST website which name is "STM32H7-Peripheral-USART interface (USART)". Write it google you will find this document. I attached the photo of the part where I solved my own problem.

 

us.PNG

 

Hello,

Missing HSE in the documentation doesn't mean that HSE should not be used. So how did you select HSE for the USARt if you are using CubeMx? that doesn't make sense. The USART should not select HSE for it. So in that case how did you use HSE as clock source for USART?

For example the UART examples on the  STM32H743I-EVAL board use HSE as source clock. So your issue is something else. You need to share your project.

https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Examples/UART/UART_Printf

From void SystemClock_Config(void):

 

 

 

 

static void SystemClock_Config(void)
{
.
.
  /* Enable HSE Oscillator and activate PLL with HSE as source */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.HSIState = RCC_HSI_OFF;
  RCC_OscInitStruct.CSIState = RCC_CSI_OFF;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;

 

 

Sorry, I need to unmark the solution untill the issue is well understood.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Chaotic
Associate II

Before the problem is solved, i chose the HSE from the clock configuration in CubeMX. After i read the documentation, i chose the HSI clock and my problem is solved. Uart receiver and transmitter is working fine now. I dont change anything except this.

Could you please share your ioc file where you selected HSE as clock source?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.