From c426421552f290d1e11f4614423f7299fce24276 Mon Sep 17 00:00:00 2001 From: Andreas Berthoud Date: Thu, 1 Jul 2021 18:45:14 +0200 Subject: [PATCH] ble: Add HSE tuning --- nucleo-wb55-ble/Core/Src/stm32wbxx_hal_msp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nucleo-wb55-ble/Core/Src/stm32wbxx_hal_msp.c b/nucleo-wb55-ble/Core/Src/stm32wbxx_hal_msp.c index afec4dc..b853f27 100644 --- a/nucleo-wb55-ble/Core/Src/stm32wbxx_hal_msp.c +++ b/nucleo-wb55-ble/Core/Src/stm32wbxx_hal_msp.c @@ -22,7 +22,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* USER CODE BEGIN Includes */ - +#include "otp.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -64,7 +64,15 @@ void HAL_MspInit(void) { /* USER CODE BEGIN MspInit 0 */ + OTP_ID0_t * p_otp; + /* + * Read HSE_Tuning from OTP + */ + p_otp = (OTP_ID0_t *) OTP_Read(0); + if (p_otp) { + LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning); + } /* USER CODE END MspInit 0 */ __HAL_RCC_HSEM_CLK_ENABLE();