cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB clock understanding

HardWins
Associate II

Hello everyone,

New to the world of STM32 and moving from Arduino programming to more in-deep STM32 one, I faced an issue that I solved in a way I can't understand.

I started working on a basic Blink program using STM32WB5MM-DK and the in-board RGB PWM led. I understood a little bit late that i had to configure the interrupts and clocks but well, that's how we learn.

But I still don't understand - at least - one thing. In the Clock Configuration (.ioc file) I can't get a working program if the system clock is set less to 48MHz and after some iterations, I discovered that it was in fact the APB2 timer clock that had to be at least 48MHz. In the datasheet(s) I can't find any indication on this critical value.

Is there any logic behind this value ? Or is it a side effect of something that I have not already understood ?

 

HardWins_0-1705686270000.png

 

My program is pretty similar to the led.c code in BSP example

 

Thanks !

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @HardWins and welcome to the ST Community :smiling_face_with_smiling_eyes:.

According to the Table 24 of the DS11929, the internal APB2 clock frequency can take any value between 0 and 64MHz:

STTwo32_0-1706094342724.png

PS: you can take a look at the clock configuration of the examples that are using the same board. you will find that the APB2 can take different values (not more than 48Mhz).

Best Regards.

STTwo-32

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
STTwo-32
ST Employee

Hello @HardWins and welcome to the ST Community :smiling_face_with_smiling_eyes:.

According to the Table 24 of the DS11929, the internal APB2 clock frequency can take any value between 0 and 64MHz:

STTwo32_0-1706094342724.png

PS: you can take a look at the clock configuration of the examples that are using the same board. you will find that the APB2 can take different values (not more than 48Mhz).

Best Regards.

STTwo-32

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.