cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX bug??? the generated clock frequency of cortex system timer is not what I set in CubeMX

ausera uirwaij
Associate III

As showed in captures, the cloce source of cortex system timer is AHB/8 but not core clock and the frequency of systick is 22.5Mhz. However the generated clock source is Processor clock (AHB) not AHB/8.

Is this CUBEMX BUG ??

0693W00000NpXDRQA3.png 

0693W00000NpXDWQA3.png 

0x07=0111b

Bit 2 CLKSOURCE: Clock source selection

Selects the clock source.

0: AHB/8

1: Processor clock (AHB)

5 REPLIES 5
Pavel A.
Evangelist III

This is a known bug (systick divisor ignored, remains 1).

You can set the systick divisor manually.

@Imen DAHMEN​  Is a fix planned?

Hello @ausera uirwaij​,

First let me thank you for having reported.

Could you please precise on which MCU you have observed this misbehavior ?

Also, it will be helpful if you attach you .ioc file for further check from my side.

Thanks in advance.

Khouloud.

@Khouloud OTHMAN​ Same issue with H743/753/750.

RM0433 shows the /8 divisor for systick, but I could not find it in RCC registers.

And no code for the divisor is generated.

0693W00000Npi6CQAR.png 

CubeMX v 6.5.0, library H7 v 10.0

It's the SysTick_CTRL register bit CLKSOURCE. Look at PM0214 section 4.5.1. ARM's documentation is generic and it seems that PM0253 is less adapted for STM32...

Ah, so this is the "IMPLEMENTATION DEFINED external clock".

Then SysTick_Config() macro needs too much hacking.

Maybe the systick clock parameter should go to stm32...hal_conf.h along with TICK_INT_PRIORITY. Dunno.