cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C071 clock config problem in CubeMX

TDJ
Lead

Hi ST,

I’m trying to configure the clocks for the STM32C071GBUx MCU in CubeMX (latest version, 6.17).

This MCU has two SPI interfaces, two UARTs, and two I²C peripherals. However, CubeMX only allows me to configure the clock for one UART, one I²C, and no SPI at all.

Am I missing something?

I’ve attached the complete clock configuration diagram below.

Screen Shot 2026-04-24 at 05.00.59.888 PM.png

Screen Shot 2026-04-24 at 05.03.14.420 PM.png

14 REPLIES 14
mƎALLEm
ST Employee

Hello,

You need to check what warning CubeMx is showing. Hover the mouse over the warning icon and check what it says:

mALLEm_0-1777044059121.png

Update:

I did the exercise and didn't face any issue. All the instances are available:

mALLEm_1-1777044391270.png

So check what is conflicting with SPI1, I2C1 etc ..

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.

Hello @mƎALLEm,

Thank you for your response, but I’m afraid it didn’t address my question.

The second image I attached—which shows various conflicts—was only meant to illustrate the available interfaces for this MCU. The conflicts, warnings, or the unavailability of SPI1 are expected and not the issue here.

The actual problem is that the clock configuration for the interfaces that are both available and enabled (I2C2 and UART2) does not appear on the clock configuration screen, as shown in the first image.

Kind Regards,

Thomas

MM..1
Chief III

Regards your question, yes you miss, that peripherals share clocks based on bus for example APB1 ... Some special can switch more as one clock source , and this you see in clock screen. Other isnt showed , sometimes is listed sometimes not. Reference pdf is right source.

TDJ
Lead

Hello @MM..1 

After several years of dealing with ST's MCUs I do understand that some peripherals may share clock sources, and in such cases the CubeMX clock tree diagram usually makes this explicit. However, in this instance, the diagram does not indicate that clearly - SPI interfaces are not shown at all on the clock diagram.

I have reviewed the relevant ST documentation, specifically RM0490 and DS14693, but they do not clearly specify the clock sources for I2C2 and SPI. This lack of clarity is precisely why I took the time to write this post, hoping to receive a definitive explanation.

The responses provided so far, while appreciated, essentially suggest that the clock source “may be this or that” and recommend further study of the PDF documentation. With all due respect, this is not the level of clarity one would expect when seeking guidance from ST, particularly from an engineer at the Chief III level. I would greatly appreciate a more precise and authoritative clarification.

Sorry , but i too many years work with MX and accept as free wizard with never 100% . But here i dont see problem

as in pdf only peripherals showed in clock tree have configurable clocks . And Clock tree AI maybe remove SPI1 because is marked red. Plus all other is marked here

MM1_0-1777124614939.png

and is in https://www.st.com/resource/en/datasheet/stm32c071gb.pdf 

Hello @TDJ ,


@TDJ wrote:

Hello @MM..1 

one would expect when seeking guidance from ST, particularly from an engineer at the Chief III level. 


1- @MM..1 is not a ST engineer and he's a community member like you trying to help you as he can..

2- I see your point now. I'll escalate it internally for analysis. I'll get back to you as soon as I have a feedback.

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.
mƎALLEm
ST Employee

By referring to the reference manual RM0490, / Figure 9. Clock tree:

mALLEm_2-1777282997629.png

You can see there are some communication peripheral instances have independent clock sources (USART1, I2C1..). Only these instances have independent clock source to configure the clock source. Other instances (USART2, SPI2 ..) have only one clock source which is generated from APB:

mALLEm_3-1777283399580.png

i.e.:

mALLEm_4-1777283511174.png

See also the section: 6.4.20 RCC peripherals independent clock configuration register 1:

mALLEm_0-1777282886169.png

So CubeMx is correct.

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.

Ok , but i ask too for detail in C071 pdf in table exist SPI1 idependent clock current , then where is it?

MM1_0-1777295197071.png

 

@MM..1 ,

Sorry I didn't catch your point. I don't see a relation between the clock source and the current consumption here?

If SPI1 is indicated as it has a relation with APB that means it is accessed over APB not necessarily clocked from it. From the reference manual:

mALLEm_0-1777298696335.png

All comm peripherals are on APB bus but not all of them are clocked over APB clock.

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.