target/stm32f1: fix split-bank erase #1719
Merged
+1
−1
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.
Add a missing
bank_offset
when checking for bank unlock completion.Detailed description
Discovered while testing #1709 on a GD32F303CGT6 target. It probably affects all split-bank STM32F1 parts or compatibles, as long as they have split flash banks.
The check for flash bank unlock completion failed for bank 2, because it was checking the register for bank 1. This probably went unnoticed for quite a while, because bank 2 is likely used for application data storage instead of code.
Only tested against GD32F303CGT6, which has split flash banks. Testing could only occur in conjunction with #1709, with which it merged cleanly. I don't have access to any other affected targets.
Your checklist for this pull request
make PROBE_HOST=native
)make PROBE_HOST=hosted
)Closing issues
N/A