Skip to content

Commit dbb0695

Browse files
authored
Merge pull request ARMmbed#12202 from LMESTM/Increase_MSI_Freq_out_of_deep_sleep
Increase MSI clock frequency when exiting deep sleep
2 parents 40b7901 + 022c0eb commit dbb0695

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

targets/TARGET_STM/sleep.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ static void ForceOscOutofDeepSleep(void)
9898
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
9999
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
100100
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
101-
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_4; // Intermediate freq, 1MHz range
101+
#if defined RCC_MSIRANGE_11
102+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11; // Highest freq, 48MHz range
103+
#else
104+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; // 4MHz range
105+
#endif
102106
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
103107
#else /* defined RCC_SYSCLKSOURCE_MSI */
104108
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;

0 commit comments

Comments
 (0)