mirror of https://github.com/ARMmbed/mbed-os.git
STM32F7: move cache initialization
parent
8ed0f26d80
commit
6e71398e3c
|
@ -30,23 +30,23 @@
|
||||||
// This function is called after RAM initialization and before main.
|
// This function is called after RAM initialization and before main.
|
||||||
void mbed_sdk_init()
|
void mbed_sdk_init()
|
||||||
{
|
{
|
||||||
// Update the SystemCoreClock variable.
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
HAL_Init();
|
|
||||||
|
|
||||||
#if TARGET_STM32F7
|
#if TARGET_STM32F7
|
||||||
// The mbed_sdk_init can be called either during cold boot or during
|
// The mbed_sdk_init can be called either during cold boot or during
|
||||||
// application boot after bootloader has been executed.
|
// application boot after bootloader has been executed.
|
||||||
// In case the bootloader has already enabled the cache,
|
// In case the bootloader has already enabled the cache,
|
||||||
// is is needed to not enable it again.
|
// is is needed to not enable it again.
|
||||||
if (SCB->CCR & (uint32_t)SCB_CCR_IC_Msk == 0) { // If ICache is disabled
|
if ((SCB->CCR & (uint32_t)SCB_CCR_IC_Msk) == 0) { // If ICache is disabled
|
||||||
SCB_EnableICache();
|
SCB_EnableICache();
|
||||||
}
|
}
|
||||||
if (SCB->CCR & (uint32_t)SCB_CCR_DC_Msk == 0) { // If DCache is disabled
|
if ((SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) == 0) { // If DCache is disabled
|
||||||
SCB_EnableDCache();
|
SCB_EnableDCache();
|
||||||
}
|
}
|
||||||
#endif /* TARGET_STM32F7 */
|
#endif /* TARGET_STM32F7 */
|
||||||
|
|
||||||
|
// Update the SystemCoreClock variable.
|
||||||
|
SystemCoreClockUpdate();
|
||||||
|
HAL_Init();
|
||||||
|
|
||||||
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
/* Configure the System clock source, PLL Multiplier and Divider factors,
|
||||||
AHB/APBx prescalers and Flash settings */
|
AHB/APBx prescalers and Flash settings */
|
||||||
SetSysClock();
|
SetSysClock();
|
||||||
|
|
Loading…
Reference in New Issue