Merge pull request #737 from openmv/cache

Fix hardfault on disable D cache.
This commit is contained in:
Ibrahim Abd Elkader 2020-03-04 19:25:58 +02:00 committed by GitHub
commit 30f9ce7903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,13 +68,17 @@ void HAL_MspInit(void)
/* Enable I/D cache */ /* Enable I/D cache */
#if defined(MCU_SERIES_F7) ||\ #if defined(MCU_SERIES_F7) ||\
defined(MCU_SERIES_H7) defined(MCU_SERIES_H7)
/* Disable and Invalidate I-Cache */ if (SCB->CCR & (uint32_t)SCB_CCR_IC_Msk) {
SCB_DisableICache(); /* Disable and Invalidate I-Cache */
SCB_InvalidateICache(); SCB_DisableICache();
SCB_InvalidateICache();
}
/* Disable, Clean and Invalidate D-Cache */ if (SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) {
SCB_DisableDCache(); /* Disable, Clean and Invalidate D-Cache */
SCB_CleanInvalidateDCache(); SCB_DisableDCache();
SCB_CleanInvalidateDCache();
}
// Enable the CPU Caches // Enable the CPU Caches
SCB_EnableICache(); SCB_EnableICache();