cancel
Showing results for 
Search instead for 
Did you mean: 

SAI1 extern clock option, "EXTERNAL_CLOCK_VALUE" not generated from CubeMX, stm32h5xx

elia_chiarucci
Associate II

Hello, I'm using CubeMX version 6.17.0 on MacOS, with an STM32H503CBT6 mcu.

I'm trying to use an external audio crystal with a frequency of 24.576mhz, after setting the new frequency in the clock configuration tab, I get the right value in the .ioc file.

Screenshot 2026-03-01 at 16.53.13.png

Screenshot 2026-03-01 at 16.54.27.png

 

However, "EXTERNAL_CLOCK_VALUE" doesn't seem to be defined in the stm32h5xx_hal_conf.h file, and the default 12288000UL value will be used instead.

Screenshot 2026-03-01 at 16.53.52.png

 

This makes audio all choppy and distorted, unless I manually define "EXTERNAL_CLOCK_VALUE" in this file to 24576000UL.

I tried with other MCU families like the G0B1 and it will correctly generate the clock in the hal files.

Is this a bug for the h5 series?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

Hello @elia_chiarucci 

Your contribution is much appreciated.

The issue has been escalated to the development team under internal ticket ID 228076 for further analysis and resolution.

I will keep you informed as soon as updates are available.

THX

Ghofrane

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.

View solution in original post

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @elia_chiarucci 

Your contribution is much appreciated.

The issue has been escalated to the development team under internal ticket ID 228076 for further analysis and resolution.

I will keep you informed as soon as updates are available.

THX

Ghofrane

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.