Merge pull request #12086 from ABOSTM/FLASH_API_64B_ALIGNMENT

TARGET_STM: fix flash api 64bit address alignment on L4 and WB
pull/12132/head
Anna Bridge 2019-12-17 16:46:21 +00:00 committed by GitHub
commit b1b0673622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -205,7 +205,7 @@ int32_t flash_program_page(flash_t *obj, uint32_t address,
/* HW needs an aligned address to program flash, which data
* parameters doesn't ensure */
if ((uint32_t) data % 4 != 0) {
if ((uint32_t) data % 8 != 0) {
volatile uint64_t data64;
while ((address < (StartAddress + size)) && (status == 0)) {
for (uint8_t i = 0; i < 8; i++) {

View File

@ -154,7 +154,7 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
StartAddress = address;
/* HW needs an aligned address to program flash, which data parameters doesn't ensure */
if ((uint32_t) data % 4 != 0) { // Data is not aligned, copy data in a temp buffer before programming it
if ((uint32_t) data % 8 != 0) { // Data is not aligned, copy data in a temp buffer before programming it
volatile uint64_t data64;
while ((address < (StartAddress + size)) && (status == 0)) {
for (uint8_t i = 0; i < 8; i++) {