We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0712b8a commit a6895dfCopy full SHA for a6895df
hal/targets/hal/TARGET_STM/TARGET_STM32F1/serial_api.c
@@ -34,6 +34,7 @@
34
35
#include "cmsis.h"
36
#include "pinmap.h"
37
+#include "mbed_error.h"
38
#include <string.h>
39
#include "PeripheralPins.h"
40
@@ -67,7 +68,12 @@ static void init_uart(serial_t *obj)
67
68
UartHandle.Init.Mode = UART_MODE_TX_RX;
69
}
70
- HAL_UART_Init(&UartHandle);
71
+ // Fix because HAL_RCC_GetHCLKFreq() don't update anymore SystemCoreClock
72
+ SystemCoreClockUpdate();
73
+
74
+ if (HAL_UART_Init(&UartHandle) != HAL_OK) {
75
+ error("Cannot initialize UART\n");
76
+ }
77
78
79
0 commit comments