2016-12-14 10:36 AM
The Nucleo_F767ZI board has 4 crystals onboard:
H
z connected to STM32F767ZI for HSE input clockFrom this information, it is only logical to conclude that the 25 MHz crystal is connected to HSE input of the microcontroller. However, CubeMX fills in 8 MHz by default for the Nucleo board. It looks like that is plain wrong:
I currently work with mbed-OS from ARM on this Nucleo board. I use the official mbed version that you can clone from github. I have noticed that this OS uses the ST HAL under the hood to access the chip hardware. So I don't use CubeMX to generate any code. Neverhteless, I discovered that the value of the crystal is also wrong in the HAL running under mbed-OS. Look at these files:
system_stm32f7xx.c
( mbed-os/targets/TARGET_STM/TARGET_STM32F7/
TARGET_NUCLEO_F767ZI/device/system_stm32f7xx.c )
&sharpif
!defined
(HSE_VALUE)&sharpdefine
HSE_VALUE ((uint32_t
)8000000)/*!< Default value of the External
oscillator in Hz */
&sharpendif
/* HSE_VALUE */
stm32f7xx_hal_conf.h
( mbed-os/targets/TARGET_STM/TARGET_STM32F7/
TARGET_NUCLEO_F767ZI/device/stm32f7xx_hal_conf.h )
&sharpif
!defined
(HSE_VALUE)&sharpdefine
HSE_VALUE8000000U
/*!< Value of the External
oscillator in Hz */
&sharpendif
/* HSE_VALUE */
Naturally I fixed the bug by changing
HSE_VALUE
from 8 MHz to 25 MHz:&sharpdefine
HSE_VALUE ((
uint32_t
)25000000)
Unfortunately, this messes up just about everything. My SPI clocks fall down to a much lower frequency, and the mbed serial logger outputs nonsense characters. Probably because the baud rate is no longer correct.
So how can I correct this bug?
#stm32f7 #clock #!stm32-!cubemx-!bug-!pll-!clock #hse #cubemx-bugSolved! Go to Solution.
2016-12-14 10:45 AM
The 25MHz crystal is not connected to the 'F7, due to the default setting of solder bridges. By default, the HSE is fed from the MCO output of the STLink mcu (and that's 8MHz). Read 6.7.1 OSC clock supply chapter in the Nucleo144's manual,
http://www.st.com/resource/en/user_manual/dm00244518.pdf
.JW
2016-12-14 10:45 AM
The 25MHz crystal is not connected to the 'F7, due to the default setting of solder bridges. By default, the HSE is fed from the MCO output of the STLink mcu (and that's 8MHz). Read 6.7.1 OSC clock supply chapter in the Nucleo144's manual,
http://www.st.com/resource/en/user_manual/dm00244518.pdf
.JW
2016-12-14 11:52 AM
Thank you Jan,
That's really helpful!I read in that paragraph '6.8.1 OSC clock supply' that with some solder bridges you can connect crystal X3 (which is not soldered on the board yet) to the STM32F7xx chip.Anyway, what is the 25 MHz crystal X4 meant for? Perhaps the ethernet?
Thanks a lot for your helpful answer :)
2016-12-14 12:59 PM
X4 clocks the Ethernet PHY chip, it is not directly connected to the STM32, comes back in via the RMII clock.
The User Manual provides a schematic.
The ST-LINK's F103 uses it's PA8 (MCO) to export its internal clocking, and is clocked externally via an 8 MHz HSE crystal. The F7 would take this as an HSE-BYPASS type source, like it would with a TCXO or other oscillator source.
2016-12-14 01:15 PM
It is worth noting that the NUCLEO-F446ZE is totally devoid of any of the ethernet circuitry. The F303ZE probably doesn't have it either, but I don't have one at this point.
The page on the product really doesn't make that clear at all
http://www.st.com/en/evaluation-tools/nucleo-f446ze.html
''IEEE-802.3-2002 compliant Ethernet connector (depending on STM32 support)'' Should perhaps be more explicit.
2017-01-23 11:10 AM
Thank you Clive One :)
Your answers are really helpful.