@@ -37,7 +37,6 @@ void stm32_peripherals_clocks_init(void) {
3737 RCC_OscInitTypeDef RCC_OscInitStruct = {0 };
3838 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0 };
3939 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0 };
40- bool lse_failure = false;
4140
4241 // Set voltage scaling in accordance with system clock speed
4342 HAL_PWREx_ConfigSupply (PWR_LDO_SUPPLY );
@@ -73,15 +72,9 @@ void stm32_peripherals_clocks_init(void) {
7372 RCC_OscInitStruct .PLL .PLLVCOSEL = RCC_PLL1VCOWIDE ;
7473 RCC_OscInitStruct .PLL .PLLFRACN = 0 ;
7574 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 );
8578 }
8679
8780 // Configure bus clock sources and divisors
@@ -116,8 +109,4 @@ void stm32_peripherals_clocks_init(void) {
116109
117110 // Enable USB Voltage detector
118111 HAL_PWREx_EnableUSBVoltageDetector ();
119-
120- if (lse_failure ) {
121- reset_into_safe_mode (HARD_CRASH ); //TODO: make safe mode category CLOCK_FAULT?
122- }
123112}
0 commit comments