Skip to content

STM32: add weak TargetBSP_Init function #13022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ------------------*/
Expand Down
19 changes: 19 additions & 0 deletions targets/TARGET_STM/mbed_overrides.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
}