diff --git a/src/main/fc/init.c b/src/main/fc/init.c index 1b78b59bf2..e5a7a51d61 100644 --- a/src/main/fc/init.c +++ b/src/main/fc/init.c @@ -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(); diff --git a/src/main/startup/system_stm32f7xx.c b/src/main/startup/system_stm32f7xx.c index 36cfea6760..182b8a789c 100644 --- a/src/main/startup/system_stm32f7xx.c +++ b/src/main/startup/system_stm32f7xx.c @@ -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();