Skip to content

Commit 7efdba3

Browse files
committed
chore(h5): update STM32H5xx system source file
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent f80a7fc commit 7efdba3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

system/STM32H5xx/system_stm32h5xx.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,19 @@ void SystemInit(void)
196196
#endif
197197

198198
/* Reset the RCC clock configuration to the default reset state ------------*/
199-
/* Set HSION bit */
200-
RCC->CR = RCC_CR_HSION;
199+
/* Set HSION bit while preserving the current HSIDIV value*/
200+
RCC->CR = (RCC->CR & RCC_CR_HSIDIV_Msk) | RCC_CR_HSION;
201201

202202
/* Reset CFGR register */
203203
RCC->CFGR1 = 0U;
204204
RCC->CFGR2 = 0U;
205205

206206
/* Reset HSEON, HSECSSON, HSEBYP, HSEEXT, HSIDIV, HSIKERON, CSION, CSIKERON, HSI48 and PLLxON bits */
207207
#if defined(RCC_CR_PLL3ON)
208-
RCC->CR &= ~(RCC_CR_HSEON | RCC_CR_HSECSSON | RCC_CR_HSEBYP | RCC_CR_HSEEXT | RCC_CR_HSIDIV | RCC_CR_HSIKERON | \
208+
RCC->CR &= ~(RCC_CR_HSEON | RCC_CR_HSECSSON | RCC_CR_HSEBYP | RCC_CR_HSEEXT | RCC_CR_HSIKERON | \
209209
RCC_CR_CSION | RCC_CR_CSIKERON |RCC_CR_HSI48ON | RCC_CR_PLL1ON | RCC_CR_PLL2ON | RCC_CR_PLL3ON);
210210
#else
211-
RCC->CR &= ~(RCC_CR_HSEON | RCC_CR_HSECSSON | RCC_CR_HSEBYP | RCC_CR_HSEEXT | RCC_CR_HSIDIV | RCC_CR_HSIKERON | \
211+
RCC->CR &= ~(RCC_CR_HSEON | RCC_CR_HSECSSON | RCC_CR_HSEBYP | RCC_CR_HSEEXT | RCC_CR_HSIKERON | \
212212
RCC_CR_CSION | RCC_CR_CSIKERON |RCC_CR_HSI48ON | RCC_CR_PLL1ON | RCC_CR_PLL2ON);
213213
#endif
214214

0 commit comments

Comments
 (0)