mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix hardfault on disable D cache.
* Disable and clean caches only if they're enabled.
This commit is contained in:
parent
64253a6c28
commit
194b068eea
@ -68,13 +68,17 @@ void HAL_MspInit(void)
|
||||
/* Enable I/D cache */
|
||||
#if defined(MCU_SERIES_F7) ||\
|
||||
defined(MCU_SERIES_H7)
|
||||
/* Disable and Invalidate I-Cache */
|
||||
SCB_DisableICache();
|
||||
SCB_InvalidateICache();
|
||||
if (SCB->CCR & (uint32_t)SCB_CCR_IC_Msk) {
|
||||
/* Disable and Invalidate I-Cache */
|
||||
SCB_DisableICache();
|
||||
SCB_InvalidateICache();
|
||||
}
|
||||
|
||||
/* Disable, Clean and Invalidate D-Cache */
|
||||
SCB_DisableDCache();
|
||||
SCB_CleanInvalidateDCache();
|
||||
if (SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) {
|
||||
/* Disable, Clean and Invalidate D-Cache */
|
||||
SCB_DisableDCache();
|
||||
SCB_CleanInvalidateDCache();
|
||||
}
|
||||
|
||||
// Enable the CPU Caches
|
||||
SCB_EnableICache();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user