Usart1 BRR register seems strange when using STM32H743 with stm32cubeh7 1.12.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-12 4:14 AM
Dear all,
I have encountered an strange issue. I set Usart1 Baud Rate to 115200, however, Usart1 BRR[15:4]==0x0082, which corresponds to 57600.(57600 == 120Mhz/(16*0x82)).
I also noticed that HAL_RCC_GetPCLK2Freq() returns a wrong pclk value 0x0E4E1C00(240M), but it should be 120M.
The Usart1 Config and Rcc config are as follows :
Solved! Go to Solution.
- Labels:
-
RCC
-
STM32H7 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-12 5:49 AM - edited ‎2025-04-12 6:04 AM
This has been an issue in the past. Is your STM32H7 package fully updated? If so, can you include your IOC file here?
The relevant fix was made 4 months ago. (Might not be this exact change.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-12 5:49 AM - edited ‎2025-04-12 6:04 AM
This has been an issue in the past. Is your STM32H7 package fully updated? If so, can you include your IOC file here?
The relevant fix was made 4 months ago. (Might not be this exact change.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-12 4:36 PM
> The relevant fix was made 4 months ago
This line with D1CorePrescalerTable array has not been changed recently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-12 6:30 PM
I am sure it's the lastest version 1.12.1. But the details remain the same as 1.12.0. I guess the 1.12.1 release missed this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-13 4:32 PM
Can you compare the generated code, especially for SystemClock_Config?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-13 5:47 PM
Works for me on a new project, updated tools. Nucleo H743 board. USART1.
printf("HAL_RCC_GetHCLKFreq() = %u\n", (unsigned)HAL_RCC_GetHCLKFreq());
printf("HAL_RCC_GetPCLK2Freq() = %u\n", (unsigned)HAL_RCC_GetPCLK2Freq());
printf("USART1->BRR = %u\n", (unsigned)USART1->BRR);
printf("baud = %.6g\n", (unsigned)HAL_RCC_GetPCLK2Freq() / (float)USART1->BRR);
printf("main loop started!\n");
Output:
HAL_RCC_GetHCLKFreq() = 240000000
HAL_RCC_GetPCLK2Freq() = 120000000
USART1->BRR = 1042
baud = 115163
