Move enabling of caches for F7

Moves cache enabling from SystemInit() to init() as it is not recommended to enable caches before entering main function.
This commit is contained in:
Hans Christian Olaussen 2019-03-10 20:11:26 +01:00
parent 52c4e96c88
commit 3597e899c9
2 changed files with 16 additions and 14 deletions

View File

@ -249,6 +249,22 @@ void init(void)
HAL_Init();
#endif
#if defined(STM32F7)
/* Enable I-Cache */
if (INSTRUCTION_CACHE_ENABLE) {
SCB_EnableICache();
}
/* Enable D-Cache */
if (DATA_CACHE_ENABLE) {
SCB_EnableDCache();
}
if (PREFETCH_ENABLE) {
LL_FLASH_EnablePrefetch();
}
#endif
printfSupportInit();
systemInit();

View File

@ -345,20 +345,6 @@ void SystemInit(void)
}
SCB->VTOR = vtorOffset;
/* Enable I-Cache */
if (INSTRUCTION_CACHE_ENABLE) {
SCB_EnableICache();
}
/* Enable D-Cache */
if (DATA_CACHE_ENABLE) {
SCB_EnableDCache();
}
if (PREFETCH_ENABLE) {
LL_FLASH_EnablePrefetch();
}
/* Configure the system clock to specified frequency */
SystemClock_Config();