Skip to main content
Associate II
October 20, 2026
Question

Missing PeriphCommonClock_Config() definition

Setup

I am programming a STM32H7 in STM32Cube VSCode. I have two peripherals (SPI1 & SPI2) connected to the same clock PER_CK.

Issue

CubeMX is supposed to generate the clock configuration code inside the PeriphCommonClock_Config() function (because several peripheral share the same clock). Inside Boot, everything is done fine. Inside Appli, the function PeriphCommonClock_Config() is declared and called correctly. However, its definition is missing inside main.c. This yields : 

 
[build] [...]/fw/Appli/Core/Src/main.c:97:(.text.main+0x10): undefined reference to `PeriphCommonClock_Config'

Current Workaround

I am currently defining PeriphCommonClock_Config() inside “USER” code blocks. This allows the build to happen with no problem. However, if I make changes to the Clock Tree and regenerate code from CubeMX, then I will need not to forget to adapt my definition of the function. This can’t stay like that.

Question

Can someone confirm this is an issue and not expected behavior from CubeMX ? Can someone provide another workaround in the meantime ? Is there a fix in the pipe for the future CubeMX version ?

3 replies

ST Technical Moderator
October 20, 2026

Hello ​@neo-knight-td 

Thank you for reporting this behavior,

Could you provide an IOC in order to verify the issue?

KR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Associate II
October 21, 2026

The corresponding .ioc file attached

ST Technical Moderator
October 21, 2026

Hello ​@neo-knight-td 

I will escalate this issue internally to the dedicated team. Internal ticket number: CDM0066785 (This is an internal tracking number and is not accessible or usable by customers.)

BR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.