Disable, clean and invalidate before enabling the cache.

This commit is contained in:
iabdalkader 2020-02-19 19:46:16 +02:00
parent 35b4e34253
commit af7bccbfbb

View File

@ -68,11 +68,15 @@ void HAL_MspInit(void)
/* Enable I/D cache */
#if defined(MCU_SERIES_F7) ||\
defined(MCU_SERIES_H7)
// Invalidate CPU cache
/* Disable and Invalidate I-Cache */
SCB_DisableICache();
SCB_InvalidateICache();
SCB_InvalidateDCache();
// Enable the CPU Cache
/* Disable, Clean and Invalidate D-Cache */
SCB_DisableDCache();
SCB_CleanInvalidateDCache();
// Enable the CPU Caches
SCB_EnableICache();
SCB_EnableDCache();
#endif