2019-10-23 07:51 PM
I am trying to make UART printf work with STM32F746-DISCO board.
I tried running printf successfully with a default clock (whatever it is--I am not sure).
I was doing it without using STM32CubeMX code generator.
Now I found the code generator to be useful, I tried using the SystemClock_Config() function it generated for my board, which increases the clock speed up to 200MHz from my understanding.
However, when I increase the clock speed with the SystemClock_Config() function, my printf does not work.
Specifically, by using a logic analyzer, I figured that the baud rate becomes too fast, around 359689 (when I set it to 115200).
I am attaching my main code below -- it is mostly just a stripped-down version of what STM32CubeMX gave me.
If I comment out SystemClock_Config() from the code, the printf works fine.
Can anyone help me with what is happening?
Thank you
Solved! Go to Solution.
2019-10-23 10:33 PM
From stm32f4xx_hal_rcc.c :
* @note (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value
* 25 MHz), user has to ensure that HSE_VALUE is same as the real
* frequency of the crystal used. Otherwise, this function may
* have wrong result.
JW
2019-10-23 10:33 PM
From stm32f4xx_hal_rcc.c :
* @note (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value
* 25 MHz), user has to ensure that HSE_VALUE is same as the real
* frequency of the crystal used. Otherwise, this function may
* have wrong result.
JW
2019-10-24 04:24 AM
Check HSE_VALUE define in stm32f7xx_hal_conf.h
2019-10-24 09:44 AM
Thanks! I am using my own make in Linux and a wrong hal_conf.h file was getting included.