diff --git a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_stm32h7xx.c b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_stm32h7xx.c index 17720f6ac1..3af62b6959 100644 --- a/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_stm32h7xx.c +++ b/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_stm32h7xx.c @@ -139,20 +139,6 @@ const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, * @{ */ -/** - * @brief Setup the target board-specific configuration - * of the microcontroller - * - * @note If used, this function should be implemented - * elsewhere. This declaration is weak so it may be overridden - * by user code. - * - * @param None - * @retval None - */ -__weak void TargetBSP_Init(void) { - /** Do nothing */ -} /** * @brief Setup the microcontroller system @@ -232,9 +218,6 @@ void SystemInit(void) #endif /* CORE_CM7*/ - /* BSP initialization hook (external RAM, etc) */ - TargetBSP_Init(); - #ifdef CORE_CM4 /* Configure the Vector Table location add offset address ------------------*/ diff --git a/targets/TARGET_STM/mbed_overrides.c b/targets/TARGET_STM/mbed_overrides.c index a006a7563c..f8c19b6991 100644 --- a/targets/TARGET_STM/mbed_overrides.c +++ b/targets/TARGET_STM/mbed_overrides.c @@ -31,6 +31,22 @@ int mbed_sdk_inited = 0; extern void SetSysClock(void); +/** + * @brief Setup the target board-specific configuration + * of the microcontroller + * + * @note If used, this function should be implemented + * elsewhere. This declaration is weak so it may be overridden + * by user code. + * + * @param None + * @retval None + */ +MBED_WEAK void TargetBSP_Init(void) { + /** Do nothing */ +} + + // This function is called after RAM initialization and before main. void mbed_sdk_init() { @@ -150,5 +166,8 @@ void mbed_sdk_init() #endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */ #endif /* DEVICE_RTC */ + /* BSP initialization hook (external RAM, etc) */ + TargetBSP_Init(); + mbed_sdk_inited = 1; }