Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

STM32: add support for LPTIM time driver #3515

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrenderle
Copy link
Contributor

No description provided.

@Dirbaio
Copy link
Member

Dirbaio commented Nov 7, 2024

Most STM32s have LPTIMs with only 1 channel, U5 is the only one with two. The existing time driver needs at least two channels, one for the half-period overflow and another for at least one user's alarm. This means there's no way it's going to work on other STM32s.

I think it'd be best to write a separate driver just for LPTIMs, designed for 1 channel. It should be possible to do without the mid-overflow interrupt if you take it into account in now() with a retry loop.

@chrenderle
Copy link
Contributor Author

I will do that. This is just to show that it works. Now that I have a understanding of the time driver and lptim I can implement it with only 1 channel.

@chrenderle
Copy link
Contributor Author

@Dirbaio could you please have a look at it? I implemented the time driver as you said. This is only a first draft. I need to check everything again. I also need to check the whole memory ordering stuff.

It can confirm it works on my Nucleo U575ZI-Q.

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