cpu/stm32/gpio_f1: fix IRQ handler #16478
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This is a follow-up for #16272 for the STM32F1 family. The same description applies. I was able to reproduce the described problem with a STM32F103RC. Compared to #16272 it's pretty hard to trigger that race. It took me hours of patience. Reducing the system clock to 8MHz seems to raise the probability of running into the described race condition
To verify the described race condition you can checkout the Reference Manual page 207 Figure 20.
Testing procedure
I wrote a poor-man's frequency counter, measuring a NE555 multi-vibrator running at 33kHz (i.e. 33.000 IRQs per second) I had laying around:
Without this patch, the program stalls after a few hours. With this patch it runs for days (and is still running).
Issues/PRs references
#16272