Skip to content

stm32: U5 time-driver-lptim improvements#6536

Merged
xoviat merged 2 commits into
embassy-rs:mainfrom
gekkonid:stm32u5-lptim-time-driver
Jul 17, 2026
Merged

stm32: U5 time-driver-lptim improvements#6536
xoviat merged 2 commits into
embassy-rs:mainfrom
gekkonid:stm32u5-lptim-time-driver

Conversation

@kdm9

@kdm9 kdm9 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Hi folks,

I've tried to get time-driver-lptim working on stm32u5, and found a couple of small changes were needed. Effectively, this PR just expands #5963 to the equivalently-operating u3/u5 chips.

I'm reasonably new to the innards of embassy, so please advise if there are smarter ways to handle this. Also note, I've only tested this on u575, but during a review of my patch, AI suggested that this should also apply to u3, so I've included U3 too. The stm32-data table supports this, but I have no u3 to test on.

Best,
K

kdm9 added 2 commits July 17, 2026 16:49
U3/u5 uses the same registers as WBA, so expand the LPTIMv2a feature
gating to these chips. One difference is that the default clock is Msik,
not Pclk1, ensure_lptim_clk!() calls have been adjusted accordingly.
Two RCC register values were missing to allow time-driver-lptimX to wake
from STOP on u5/u3:

- LPTIM1AMEN: enable LPBAM/timer autonomous mode in Stop0/1/2
- APB3SMEN: keep the APB clock available to route timer interrupts to
  NVIC in Stop mode
@xoviat
xoviat added this pull request to the merge queue Jul 17, 2026
Merged via the queue into embassy-rs:main with commit 2f0b39d Jul 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants