Skip to main content
Dat Tran
Senior II
March 9, 2023
Solved

STM32MP151: How do we change crystal HSE from 24MHz to 8MHz?

  • March 9, 2023
  • 2 replies
  • 1966 views

Hi, we would like to change from 24MHz to 8MHz which is available in our stock, I see in device tree, file stm32mp151.dtsi

clocks {

clk_hse: clk-hse {

#clock-cells = <0>;

compatible = "fixed-clock";

clock-frequency = <24000000>;

};

.....

I changed clock-frequency = <8000000>;

Is that enough or I do have to set some other config? If there is some other places need to change, could you tell me which ones should be, please?

This topic has been closed for replies.
Best answer by PatrickF

Hi,

This is usually enough... but...

You should adapt some PLL settings due to new HSE frequency.

You must also change USB clock source to PLL4R as 8 MHz is not supported in direct (in CubeMx, USB PLL should receive either precise 19.2, 24, 26, 30 or 38.4 MHz). Changing PLL4 frequency could impact other clocks and so your global clock tree.

I encourage you to use CubeMx to generate the device tree for clocking with HSE = 8MHz.

Regards,

2 replies

PatrickF
PatrickFBest answer
Technical Moderator
March 20, 2023

Hi,

This is usually enough... but...

You should adapt some PLL settings due to new HSE frequency.

You must also change USB clock source to PLL4R as 8 MHz is not supported in direct (in CubeMx, USB PLL should receive either precise 19.2, 24, 26, 30 or 38.4 MHz). Changing PLL4 frequency could impact other clocks and so your global clock tree.

I encourage you to use CubeMx to generate the device tree for clocking with HSE = 8MHz.

Regards,

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
Dat Tran
Dat TranAuthor
Senior II
March 21, 2023

Yes, I use STM32CubeMX generate the clock configuration and get it working.