Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

variant(g4): Fix clock config of WeAct STM32G474CoreBoard #2619

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

ALTracer
Copy link
Contributor

@ALTracer ALTracer commented Jan 6, 2025

Summary

This PR fixes the following bugs:

  • HSE_VALUE defaulting to 24'000000 from hal_conf, override to 8'000000 in variant.h
  • USB clocksource was HSI48 without CRS, enable CRS

Not touching generic_clock.cpp, that looks fine (HSI16 div4 into 150 MHz and CRS HSI48). I would like to rename its RCC_CRSInitTypeDef pInit to RCC_CRSInitStruct like in this patch but it's up to naming convention, not relevant to compiled code.
LPUART1 clocksource defaults to Pclk1, I think, no need to switch it to Sysclk or HSI or LSE (because LSE XTAL is behind DNI solderbridges).

Validation

  • Ensure CI build is passed.
  • Tested with Blink and RTT SpeedTest sketches, also USB Serial (CDC-ACM)

Code formatting

  • Invoked CI/astyle/astyle.py locally.

Closing issues

Follow-up to #2615

* Override HSE value to 8 MHz not 24
* Keep PLL input above 2.66 MHz spec
* Set VCO to a multiple of USB48 and feed that from PLL, sysclk becomes 144
* Enable CRS and switch USB to HSI48, decoupling it from PLL
* Increase VCO multiplier to reach 170 MHz max spec
@fpistm fpistm self-requested a review January 6, 2025 08:38
@fpistm fpistm added the fix 🩹 Bug fix label Jan 6, 2025
@fpistm fpistm added this to the 2.10 milestone Jan 6, 2025
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fpistm fpistm merged commit 91b29fb into stm32duino:main Jan 6, 2025
24 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
fix 🩹 Bug fix
Projects
Development

Successfully merging this pull request may close these issues.

2 participants