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

Fix STM32 Monotonic for peripherals with only two Clock Compare modules #960

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

Finomnis
Copy link
Contributor

@Finomnis Finomnis commented Jul 5, 2024

Fixes #956.
Replaces #958.

Rationale: Some timer peripherals seem to have only two clock compare modules. Therefore the half period interrupt does not fire and the monotonic sanity check triggers.

Solution: Use CC1 instead of CC3. This was more or less a typo anyway; we originally intended to use CC1 and CC2, we just ended up using CC2 and CC3 because we didn't realize that the enumeration starts with 0.

Review: @korken89

@Finomnis
Copy link
Contributor Author

Finomnis commented Jul 5, 2024

Seems to still run fine on my stm32g030, indicating that the CC indices indeed start at 0.

@great-houk, would you mind testing if this fixes your problem?

EDIT: Ran for 3800 seconds now, still fine.

@great-houk
Copy link

I can confirm it works, thanks for your help.

Copy link
Collaborator

@korken89 korken89 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@korken89 korken89 added this pull request to the merge queue Jul 5, 2024
Merged via the queue into rtic-rs:master with commit 5cafe9d Jul 5, 2024
55 checks passed
@Finomnis Finomnis deleted the fix_stm32_timer_ccr branch July 6, 2024 02:13
@Finomnis
Copy link
Contributor Author

Finomnis commented Jul 6, 2024

Thanks for the fix!

@korken89 Might want to yank the previous two releases if such a serious bug existed.

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.

rtic-monotonic panics
3 participants