FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

utility: support automatic low-speed clock detection by haydenth · Pull Request #90 · stm32duino/STM32duinoBLE · GitHub

utility: support automatic low-speed clock detection - #90

Merged
fpistm merged 1 commit into
stm32duino:mainfrom
haydenth:feature/automatic-rf-clock-source
Aug 12, 2026
Merged

utility: support automatic low-speed clock detection#90
fpistm merged 1 commit into
stm32duino:mainfrom
haydenth:feature/automatic-rf-clock-source

Conversation

Copy link
Copy Markdown

Problem

In custom or cost-optimized STM32WB designs, the external 32.768 kHz LSE crystal is often omitted to save board space and BOM cost (using internal LSI or HSE/1024 instead). However, the library currently unconditionally hangs inside waiting for the LSE oscillator to be ready:

  LL_RCC_LSE_Enable();
  while (!LL_RCC_LSE_IsReady()) {} // Hangs forever on LSE-less designs

Solution

This PR updates to dynamically read the configured RF Wakeup clock source from the registers (LL_RCC_GetRFWKPClockSource()) and only initialize what is actually selected by the system:

  • LSE: Safe, backwards-compatible, and executes the original LSE enable-and-wait sequence.
  • LSI: Safely enables LSI1 and waits for it to stabilize.
  • HSE_DIV1024: Skips any low-speed clock initialization since the high-speed crystal is already active.

This makes the library universally compatible with any custom LSE-less hardware layout out-of-the-box without requiring any user configuration flags or macros.

fpistm self-assigned this Jul 29, 2026
fpistm added the enhancement New feature or request label Aug 10, 2026
- Read RF wakeup clock source to automatically choose LSE, LSI, or HSE
- Bypasses infinite LSE loop hang on boards without LSE crystal
fpistm force-pushed the feature/automatic-rf-clock-source branch from 7646a6f to bd76b81 Compare August 12, 2026 08:05

fpistm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @haydenth

github-project-automation Bot moved this from In progress to Needs review in STM32 core based on ST HAL Aug 12, 2026
github-project-automation Bot moved this from Needs review to Reviewer approved in STM32 core based on ST HAL Aug 12, 2026
fpistm merged commit 285ca3a into stm32duino:main Aug 12, 2026
5 checks passed
github-project-automation Bot moved this from Reviewer approved to Done in STM32 core based on ST HAL Aug 12, 2026
fpistm added this to the 1.5.0 milestone Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL