Skip to main content
Kristof Mulier
Associate III
December 14, 2016
Solved

Confusion about the Crystal on Nucleo_F7xxx boards

  • December 14, 2016
  • 5 replies
  • 2290 views
Posted on December 14, 2016 at 19:36

The Nucleo_F767ZI board has 4 crystals onboard:

  • X1:     8 MHz      connected to the JTAG-chip on the STLink
  • X2:     32 kHz    connected to STM32F767ZI for real time clock
  • X3:     Not soldered
  • X4:     25 M

    H

    z    connected to STM32F767ZI for HSE input clock

From 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:

0690X00000605sMQAQ.png

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_VALUE

8000000U

 

/*!< 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-bug
This topic has been closed for replies.
Best answer by waclawek.jan
Posted on December 14, 2016 at 19:45

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

5 replies

waclawek.jan
waclawek.janBest answer
Super User
December 14, 2016
Posted on December 14, 2016 at 19:45

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

Kristof Mulier
Associate III
December 14, 2016
Posted on December 14, 2016 at 19:52

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 :)

Tesla DeLorean
Guru
December 14, 2016
Posted on December 14, 2016 at 20:59

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.

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