Merge pull request #292 from blues/swan_r5_LSE_drive
fix: Increases the drive strength of 32kHz external crystal
This commit is contained in:
commit
a7ea738052
1 changed files with 4 additions and 2 deletions
|
|
@ -28,8 +28,10 @@ void clock_init(void)
|
|||
|
||||
|
||||
/* Enable Power Control clock */
|
||||
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
// Sets the drive strength of 32kHz external crystal, in line with calculations specified in ST AN2867 sections 3.3, 3.4, and STM32L4 datasheet DS12023 Table 58. LSE oscillator characteristics.
|
||||
// The drive strength RCC_LSEDRIVE_LOW is marginal for the 32kHz crystal oscillator stability, and RCC_LSEDRIVE_MEDIUMLOW meets the calculated drive strength with a small margin for parasitic capacitance.
|
||||
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMLOW);
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST) != HAL_OK) {
|
||||
Error_Handler();
|
||||
|
|
|
|||
Loading…
Reference in a new issue