File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
hal/targets/hal/TARGET_STM/TARGET_STM32F3 Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 36
36
#include "pinmap.h"
37
37
#include <string.h>
38
38
#include "PeripheralPins.h"
39
+ #include "mbed_error.h"
39
40
40
41
#define UART_NUM (5)
41
42
@@ -69,8 +70,12 @@ static void init_uart(serial_t *obj)
69
70
// Disable the reception overrun detection
70
71
UartHandle .AdvancedInit .AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT ;
71
72
UartHandle .AdvancedInit .OverrunDisable = UART_ADVFEATURE_OVERRUN_DISABLE ;
72
-
73
- HAL_UART_Init (& UartHandle );
73
+ /* uAMR & ARM: Call to UART init is done between reset of pre-initialized variables */
74
+ /* and before HAL Init. SystemCoreClock init required here */
75
+ SystemCoreClockUpdate ();
76
+ if (HAL_UART_Init (& UartHandle ) != HAL_OK ) {
77
+ error ("Cannot initialize UART\n" );
78
+ }
74
79
}
75
80
76
81
void serial_init (serial_t * obj , PinName tx , PinName rx )
You can’t perform that action at this time.
0 commit comments