Call early init before HAL init.

* To configure and enable the external OSC before HAL_Init.
This commit is contained in:
iabdalkader 2020-02-19 18:49:15 +02:00
parent a90174cfca
commit 2a8be10ca0

View File

@ -415,6 +415,10 @@ int main(void)
#endif
bool first_soft_reset = true;
#if defined(MICROPY_BOARD_EARLY_INIT)
MICROPY_BOARD_EARLY_INIT();
#endif
// Uncomment to disable write buffer to get precise faults.
// NOTE: Cache should be disabled on M7.
//SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk;
@ -426,10 +430,6 @@ int main(void)
// NOTE: The bootloader enables the CCM/DTCM memory.
HAL_Init();
#if defined(MICROPY_BOARD_EARLY_INIT)
MICROPY_BOARD_EARLY_INIT();
#endif
#if MICROPY_HW_SDRAM_SIZE
sdram_ok = sdram_init();
#if MICROPY_HW_SDRAM_STARTUP_TEST