Skip to content

Commit 2afce67

Browse files
author
Erwan GOURIOU
committed
[STM32F4][V1.12.0] SystemCoreClock update
With ARM and uARM toolchains, SystemCoreClock is reset before UART init by libc. Fix to perform SystemCoreClock init with UART init out of HAL init.
1 parent a9b27da commit 2afce67

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ static void init_uart(serial_t *obj, UARTName instance)
182182
}
183183
#endif
184184

185+
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
186+
/* and before HAL Init. SystemCoreClock init required here */
187+
SystemCoreClockUpdate();
188+
185189
if (HAL_UART_Init(handle) != HAL_OK) {
186190
error("Cannot initialize UART\n");
187191
}

0 commit comments

Comments
 (0)