FlashIAP: Get erase value from HAL instead of hardcoding it #11752
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.
Description (required)
Summary of change (What the change is for and why)
When programming flash, if the chunk size to program is less than the page size, the buffer is padded with the erase value. The erase value is hardcoded as
0xFF
. However, since #8589, the HAL provides aflash_get_erase_value()
function.This PR replaces the hardcoded
0xFF
with the value returned byflash_get_erase_value()
. That value will be0xFF
for all existing targets. Removing the hardcoded assumption of0xFF
allows for MBed to support a target with a different erase value, which is the spirit of #8589.Documentation (Details of any document updates required)
None.
Pull request type (required)
Test results (required)