[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.
pull/1838/head
Erwan GOURIOU 2016-05-31 16:46:05 +02:00
parent a9b27da409
commit 2afce67e5c
1 changed files with 4 additions and 0 deletions

View File

@ -182,6 +182,10 @@ static void init_uart(serial_t *obj, UARTName instance)
}
#endif
/* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
/* and before HAL Init. SystemCoreClock init required here */
SystemCoreClockUpdate();
if (HAL_UART_Init(handle) != HAL_OK) {
error("Cannot initialize UART\n");
}