0
votes

I'm using the STM32F401RE Nucleo board, I have noticed that the internal clock HSI has a quite high inaccuracy over temperature and it's not suitable for my application.

I want to use an external clock for the board but I don't know how to properly install and configure the external clock?

And in STM32Cubemx, when selecting SMT32F401RE Nucleo board, in "Clock Configuration" tab, it's not possible for choosing the HSE clock, only HSI clock available.

Any example on how to use external clock source would be great for me.

Thanks

1

1 Answers

2
votes

You need to enable the HSE clock in the RCC peripheral in the Pinout tab in STM32CubeMX (Select crystal/Ceramic resonator). According to the user manual, the crystal is not provided though:

HSE oscillator on-board from X3 crystal (not provided): for typical frequencies and its capacitors and resistors, refer to STM32 microcontroller datasheet. Refer to the AN2867 Application note for oscillator design guide for STM32 microcontrollers.The X3 crystal has the following characteristics: 8 MHz, 16 pF, 20 ppm, and DIP footprint. It is recommended to use 9SL8000016AFXHF0 manufactured by Hong Kong X'tals Limited.

You can of course use a different oscillator than the one recommended.

If you also want an accurate 32K for date and time, you need to enable the RTC peripheral in the pinout tab.