-
Notifications
You must be signed in to change notification settings - Fork 219
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
[monotonics] Fix STM32 read-modify-write race condition #984
Conversation
The `SR` register for STM32 clears when writing a zero to a bit. Therefore, all registers that should not be cleared need to be `1`. `modify` here caused a read-modify-write error that could clear unrelated flags.
a8e467b
to
185bf36
Compare
Needs testing on target. |
This might be enough of a bug to yank previous |
LGTM thank for fixing! Have this been tested on HW? |
Not by me yet. |
Ping me when ready and I'll prepare a release. |
@korken89 Runs realiably in debug but crashes immediately in release. Something is wrong with the init code, give me a second. |
@korken89 Seems like that fixed it. |
2b3331a
to
e752d0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing!
The
SR
register for STM32 clears when writing a zero to a bit. Therefore, all registers that should not be cleared need to be1
.modify
here caused a read-modify-write error that could clear unrelated flags.Related: libopencm3/libopencm3#392
Fixes: #956