Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions targets/TARGET_STM/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@ __WEAK void ForceOscOutofDeepSleep(void)
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
#if defined RCC_MSIRANGE_11
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11; // Highest freq, 48MHz range
#if defined (TARGET_STM32U5)
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_0; // Highest freq for U5, 48MHz range
#elif defined (RCC_MSIRANGE_11)
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11; // Highest freq for L4/L5, 48MHz range
#else
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; // 4MHz range
#endif
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
#else /* defined RCC_SYSCLKSOURCE_MSI */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
#endif /* defined RCC_SYSCLKSOURCE_MSI */

Expand Down