insert dsb on flash write (#1160)

This commit is contained in:
Matthew Kennedy 2020-02-25 20:52:11 -08:00 committed by GitHub
parent c35f4aa2e3
commit ada5d5fee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -194,6 +194,12 @@ static void flashWriteData(flashaddr_t address, const flashdata_t data) {
/* Write the data */
*(flashdata_t*) address = data;
// Cortex-M7 (STM32F7/H7) can execute out order - need to force a full flush
// so that we actually wait for the operation to complete!
#if CORTEX_MODEL == 7
__DSB();
#endif
/* Wait for completion */
flashWaitWhileBusy();