File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
variants/STM32U5xx/U575Z(G-I)TxQ_U585ZETxQ Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ PCD_HandleTypeDef g_hpcd;
51
51
void HAL_PCD_MspInit (PCD_HandleTypeDef * hpcd )
52
52
{
53
53
const PinMap * map = NULL ;
54
- #if defined(PWR_CR2_USV )
54
+ #if defined(PWR_CR2_USV ) || defined( PWR_SVMCR_USV )
55
55
/* Enable VDDUSB on Pwrctrl CR2 register*/
56
56
HAL_PWREx_EnableVddUSB ();
57
57
#endif
@@ -136,8 +136,10 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
136
136
#ifdef __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE
137
137
__HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE ();
138
138
#endif
139
+ #ifdef __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT
139
140
__HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT ();
140
- #if !defined(STM32L4xx )
141
+ #endif
142
+ #if !defined(STM32L4xx ) && !defined(STM32U5xx )
141
143
/* Set EXTI Wakeup Interrupt priority */
142
144
HAL_NVIC_SetPriority (OTG_FS_WKUP_IRQn , USBD_IRQ_PRIO , USBD_IRQ_SUBPRIO );
143
145
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ WEAK void SystemClock_Config(void)
175
175
RCC_OscInitTypeDef RCC_OscInitStruct = {};
176
176
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
177
177
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
178
+ RCC_CRSInitTypeDef RCC_CRSInitStruct = {};
178
179
179
180
/* * Configure the main internal regulator output voltage
180
181
*/
@@ -232,6 +233,19 @@ WEAK void SystemClock_Config(void)
232
233
if (HAL_RCCEx_PeriphCLKConfig (&PeriphClkInit) != HAL_OK) {
233
234
Error_Handler ();
234
235
}
236
+ /* * Enable the SYSCFG APB clock
237
+ */
238
+ __HAL_RCC_CRS_CLK_ENABLE ();
239
+ /* * Configures CRS
240
+ */
241
+ RCC_CRSInitStruct.Prescaler = RCC_CRS_SYNC_DIV1;
242
+ RCC_CRSInitStruct.Source = RCC_CRS_SYNC_SOURCE_USB;
243
+ RCC_CRSInitStruct.Polarity = RCC_CRS_SYNC_POLARITY_RISING;
244
+ RCC_CRSInitStruct.ReloadValue = __HAL_RCC_CRS_RELOADVALUE_CALCULATE (48000000 , 1000 );
245
+ RCC_CRSInitStruct.ErrorLimitValue = 34 ;
246
+ RCC_CRSInitStruct.HSI48CalibrationValue = 32 ;
247
+
248
+ HAL_RCCEx_CRSConfig (&RCC_CRSInitStruct);
235
249
}
236
250
237
251
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments