diff --git a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c index 93a0e68527..48e13cd1f5 100644 --- a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c +++ b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c @@ -158,10 +158,6 @@ HAL_StatusTypeDef HAL_Init(void) __HAL_FLASH_ART_ENABLE(); #endif /* ART_ACCLERATOR_ENABLE */ -#if (PREFETCH_ENABLE != 0U) - __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); -#endif /* PREFETCH_ENABLE */ - /* Set Interrupt Group Priority */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); diff --git a/src/main/platform.h b/src/main/platform.h index 671a35a0df..e10cbd273f 100644 --- a/src/main/platform.h +++ b/src/main/platform.h @@ -34,6 +34,7 @@ #include "stm32f7xx_ll_rcc.h" #include "stm32f7xx_ll_bus.h" #include "stm32f7xx_ll_tim.h" +#include "stm32f7xx_ll_system.h" // Chip Unique ID on F7 #if defined(STM32F722xx) diff --git a/src/main/target/system_stm32f7xx.c b/src/main/target/system_stm32f7xx.c index 0154865c9f..bd22beadef 100644 --- a/src/main/target/system_stm32f7xx.c +++ b/src/main/target/system_stm32f7xx.c @@ -363,6 +363,10 @@ void SystemInit(void) SCB_EnableDCache(); } + if (PREFETCH_ENABLE) { + LL_FLASH_EnablePrefetch(); + } + /* Configure the system clock to specified frequency */ SystemClock_Config();