mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
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:
parent
52c4e96c88
commit
3597e899c9
2 changed files with 16 additions and 14 deletions
|
@ -249,6 +249,22 @@ void init(void)
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
#endif
|
#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();
|
printfSupportInit();
|
||||||
|
|
||||||
systemInit();
|
systemInit();
|
||||||
|
|
|
@ -345,20 +345,6 @@ void SystemInit(void)
|
||||||
}
|
}
|
||||||
SCB->VTOR = vtorOffset;
|
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 */
|
/* Configure the system clock to specified frequency */
|
||||||
SystemClock_Config();
|
SystemClock_Config();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue