@@ -36,6 +36,10 @@ const PinName digitalPin[] = {
36
36
PB_4, // SARA_RTS
37
37
PB_5, // SARA_CTS
38
38
PB_6, // Button_LED
39
+ PB_9, // DONE (TPL5110 power timer)
40
+ PC_1, // DETECT (AD5933 electrode)
41
+ PC_9, // BAT_CHRG
42
+ PA_8, // BAT_CON
39
43
};
40
44
41
45
// Analog (Ax) pin number array
@@ -65,15 +69,19 @@ WEAK void SystemClock_Config(void)
65
69
Error_Handler ();
66
70
}
67
71
72
+ /* Configure LSE Drive Capability */
73
+ HAL_PWR_EnableBkUpAccess ();
74
+ __HAL_RCC_LSEDRIVE_CONFIG (RCC_LSEDRIVE_LOW);
75
+
68
76
/*
69
77
* Initializes the RCC Oscillators according to the specified parameters
70
78
* in the RCC_OscInitTypeDef structure.
71
79
*/
72
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_LSI
73
- | RCC_OSCILLATORTYPE_HSE ;
80
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE
81
+ | RCC_OSCILLATORTYPE_LSE ;
74
82
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
83
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
75
84
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
76
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
77
85
RCC_OscInitStruct.PLL .PLLState = RCC_PLL_ON;
78
86
RCC_OscInitStruct.PLL .PLLSource = RCC_PLLSOURCE_HSE;
79
87
RCC_OscInitStruct.PLL .PLLM = 1 ;
@@ -96,12 +104,18 @@ WEAK void SystemClock_Config(void)
96
104
Error_Handler ();
97
105
}
98
106
107
+ /* Enables the Clock Security System */
108
+ HAL_RCC_EnableCSS ();
109
+
110
+ /* Enables the Clock Security System */
111
+ HAL_RCCEx_EnableLSECSS ();
112
+
99
113
/* Initializes the peripherals clock */
100
114
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_SDMMC1
101
115
| RCC_PERIPHCLK_RTC;
102
116
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
103
117
PeriphClkInit.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_HSI48;
104
- PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSI ;
118
+ PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE ;
105
119
if (HAL_RCCEx_PeriphCLKConfig (&PeriphClkInit) != HAL_OK) {
106
120
Error_Handler ();
107
121
}
0 commit comments