@@ -37,7 +37,6 @@ void stm32_peripherals_clocks_init(void) {
37
37
RCC_OscInitTypeDef RCC_OscInitStruct = {0 };
38
38
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0 };
39
39
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0 };
40
- bool lse_failure = false;
41
40
42
41
// Set voltage scaling in accordance with system clock speed
43
42
HAL_PWREx_ConfigSupply (PWR_LDO_SUPPLY );
@@ -73,15 +72,9 @@ void stm32_peripherals_clocks_init(void) {
73
72
RCC_OscInitStruct .PLL .PLLVCOSEL = RCC_PLL1VCOWIDE ;
74
73
RCC_OscInitStruct .PLL .PLLFRACN = 0 ;
75
74
if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
76
- // Failure likely means a LSE issue - attempt to swap to LSI, and set to crash
77
- RCC_OscInitStruct .LSEState = RCC_LSE_OFF ;
78
- RCC_OscInitStruct .OscillatorType |= RCC_OSCILLATORTYPE_LSI ;
79
- RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
80
- if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
81
- // No HSE means no USB, so just fail forever
82
- while (1 );
83
- }
84
- lse_failure = true;
75
+ // Clock issues are too problematic to even attempt recovery.
76
+ // If you end up here, check whether your LSE settings match your board.
77
+ while (1 );
85
78
}
86
79
87
80
// Configure bus clock sources and divisors
@@ -116,8 +109,4 @@ void stm32_peripherals_clocks_init(void) {
116
109
117
110
// Enable USB Voltage detector
118
111
HAL_PWREx_EnableUSBVoltageDetector ();
119
-
120
- if (lse_failure ) {
121
- reset_into_safe_mode (HARD_CRASH ); //TODO: make safe mode category CLOCK_FAULT?
122
- }
123
112
}
0 commit comments