STMicroelectronics / STM32CubeG0

STM32Cube MCU Full Package for the STM32G0 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
165 stars 75 forks source link

Sets incorrect SysTick frequency #14

Closed raizub closed 3 years ago

raizub commented 3 years ago

Set-up

The bug

How To Reproduce

  1. Generate main code with HSI RC, with PLLCLK to 60 MHz SYSCLK.
  2. SysTick frequency will be calculated from default 16 MHz value.

Additional context Attached image with Initialization routine from current source. I think, first should be called LL_SetSystemCoreClock(60000000); function to update SystemCoreClock variable, and only after this HAL_InitTick (TICK_INT_PRIORITY), because this function uses SystemCoreClock to set correct frequency.

Screenshots SysTick

ALABSTM commented 3 years ago

Hi @raizub,

Thank you for this report. Have you started from one of our provided examples or is it an application generated from scratch using Cube MX?

Thank you,

ALABSTM commented 3 years ago

Hi @raizub,

I found the point you have reported is related to USB-PD applications, mainly USB-PD_Consumer_1port and USB-PD_Provider_1port on the STM32G0C1E-EV board.

What you reported seems an issue indeed. It will be forwarded to our development teams for confirmation. I will get back to you as soon as I have their feedback. Thank you again for your contribution.

With regards,

rsystec commented 3 years ago

Hi @raizub,

Thank you for this report. Have you started from one of our provided examples or is it an application generated from scratch using Cube MX?

Thank you,

Hi,

The application was generated from scratch. But maybe not with the 1.4.1 package, but with some previous version (might be V1.4.0). Started using sysTick only after an update, so I noticed only then.

ALABSTM commented 3 years ago

Hi @raizub,

I hope you are fine. Please excuse this somewhat delayed reply. Actually, this issue is related to the Cube MX tool generating the SystemClock_Config() function. This is a known issue that has been internally fixed and will be made available in a future release of the Cube MX. In the meanwhile, you shall manually invert the call order of the functions as you suggested. I hope this helps.

As this revealed to be an issue related to our ecosystem, not to the software delivered within this repository, please allow me to close it. Thank you for your comprehension and thank you again for having reported.

With regards,

ALABSTM commented 3 years ago

ST Internal Reference: 100259