cancel
Showing results for 
Search instead for 
Did you mean: 

UART HAL Timebase matters?

EMurp.1
Associate II

I am running FreeRTOS on an STM32H745I board in a TouchGFX application. All tasks I want to run are on the M7 core. I'm trying to periodically send data over UART3 to the virtual COM Port of the STLink. The HAL returns an ok status when transmitting, but no data shows to my serial terminal, leading me to think it's a timing issue. I have the systick timer used as the timebase for the CM4, and TIM6 as the timebase for the CM7; this is the default option. TIM6 is fed a 100MHz clock through the APB1 domain. USART3 is configured for 115200 baud, 8 bits, 1 stop bit, no parity. Can the timebase affect the HAL UART driver, and is there a suggested setup/frequency to use here?

6 REPLIES 6
TDK
Guru

At 100+ MHz system clock, should be no problem getting 115200 baud from the UART. Perhaps the clock is not what you think it is, or the hardware connection is missing. Typically gibberish will show up if the clock rate is off, not nothing. A logic analyzer on the lines would provide the best insight.

If you feel a post has answered your question, please click "Accept as Solution".

Custom board?

Check HSE_VALUE define in stm32h7xx_hal_conf.h type files, matches the design.

Check GPIO bank clock is enabled on the core using it, those pins and AF settings are correct.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I should've been more specific. The board is an STM32H745I-Disco from STM. The hardware connectivity shouldn't be an issue since the virtual com port is connected to UART3 directly on the PCB. The HSE is set in the conf file to match the 25MHz external oscillator also connected to the stlink. Both UART pins are set as alternate function push-pulls with no pull up or pull down resistors and a maximum output speed of low in CubeMX. I'll see if hooking up the logic analyzer shows whether any data is getting transmitted at all.

TDK
Guru

> Both UART pins

USART3 can be output on different pins. Are you initializing the correct ones (PB10/PB11)?

If you feel a post has answered your question, please click "Accept as Solution".

That would be it. CubeMX had the UUSART3 pins shown as initialized to PB10 and PB11, but there was a section of initialization code remaining from TouchGFX that initialized it to PC10 & PC11. I really appreciate the help.

@EMurp.1​ If you appreciate TDK's help - why not mark his reply as best answer?