Skip to content

Commit 59df4ef

Browse files
authored
Merge pull request #13022 from jeromecoutant/PR_BSP
STM32: add weak TargetBSP_Init function
2 parents 867cd0f + 76135d0 commit 59df4ef

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_stm32h7xx.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,6 @@ const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7,
139139
* @{
140140
*/
141141

142-
/**
143-
* @brief Setup the target board-specific configuration
144-
* of the microcontroller
145-
*
146-
* @note If used, this function should be implemented
147-
* elsewhere. This declaration is weak so it may be overridden
148-
* by user code.
149-
*
150-
* @param None
151-
* @retval None
152-
*/
153-
__weak void TargetBSP_Init(void) {
154-
/** Do nothing */
155-
}
156142

157143
/**
158144
* @brief Setup the microcontroller system
@@ -232,9 +218,6 @@ void SystemInit(void)
232218

233219
#endif /* CORE_CM7*/
234220

235-
/* BSP initialization hook (external RAM, etc) */
236-
TargetBSP_Init();
237-
238221
#ifdef CORE_CM4
239222

240223
/* Configure the Vector Table location add offset address ------------------*/

targets/TARGET_STM/mbed_overrides.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@
3131
int mbed_sdk_inited = 0;
3232
extern void SetSysClock(void);
3333

34+
/**
35+
* @brief Setup the target board-specific configuration
36+
* of the microcontroller
37+
*
38+
* @note If used, this function should be implemented
39+
* elsewhere. This declaration is weak so it may be overridden
40+
* by user code.
41+
*
42+
* @param None
43+
* @retval None
44+
*/
45+
MBED_WEAK void TargetBSP_Init(void) {
46+
/** Do nothing */
47+
}
48+
49+
3450
// This function is called after RAM initialization and before main.
3551
void mbed_sdk_init()
3652
{
@@ -150,5 +166,8 @@ void mbed_sdk_init()
150166
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
151167
#endif /* DEVICE_RTC */
152168

169+
/* BSP initialization hook (external RAM, etc) */
170+
TargetBSP_Init();
171+
153172
mbed_sdk_inited = 1;
154173
}

0 commit comments

Comments
 (0)