Skip to content

Commit d6e5fac

Browse files
bcostmadbridge
authored andcommitted
STM32F7: move cache initialization
1 parent 11f629f commit d6e5fac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

targets/TARGET_STM/mbed_overrides.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@
3030
// This function is called after RAM initialization and before main.
3131
void mbed_sdk_init()
3232
{
33-
// Update the SystemCoreClock variable.
34-
SystemCoreClockUpdate();
35-
HAL_Init();
36-
3733
#if TARGET_STM32F7
3834
// The mbed_sdk_init can be called either during cold boot or during
3935
// application boot after bootloader has been executed.
4036
// In case the bootloader has already enabled the cache,
4137
// is is needed to not enable it again.
42-
if (SCB->CCR & (uint32_t)SCB_CCR_IC_Msk == 0) { // If ICache is disabled
38+
if ((SCB->CCR & (uint32_t)SCB_CCR_IC_Msk) == 0) { // If ICache is disabled
4339
SCB_EnableICache();
4440
}
45-
if (SCB->CCR & (uint32_t)SCB_CCR_DC_Msk == 0) { // If DCache is disabled
41+
if ((SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) == 0) { // If DCache is disabled
4642
SCB_EnableDCache();
4743
}
4844
#endif /* TARGET_STM32F7 */
4945

46+
// Update the SystemCoreClock variable.
47+
SystemCoreClockUpdate();
48+
HAL_Init();
49+
5050
/* Configure the System clock source, PLL Multiplier and Divider factors,
5151
AHB/APBx prescalers and Flash settings */
5252
SetSysClock();

0 commit comments

Comments
 (0)