Skip to content

Commit

Permalink
mcu/stm32: Fix clock configuration for non STM32F4xx
Browse files Browse the repository at this point in the history
Only STM32F411 devices have PLLI2S PLLM parameter.

Also TIPPresSelection is not always present but since
it was initialized with 0 initializing line is omitted.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
  • Loading branch information
kasjer committed Oct 3, 2024
1 parent a2cafe3 commit 79b107a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/mcu/stm/stm32f4xx/src/clock_stm32f4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ config_i2s_pll(void)
RCC_PeriphCLKInitTypeDef i2s_clock_init = {0};

i2s_clock_init.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S;
#if defined(STM32F411xE)
i2s_clock_init.PLLI2S.PLLI2SM = MYNEWT_VAL(STM32_CLOCK_PLLI2S_PLLM);
#endif
i2s_clock_init.PLLI2S.PLLI2SN = MYNEWT_VAL(STM32_CLOCK_PLLI2S_PLLN);
i2s_clock_init.PLLI2S.PLLI2SR = MYNEWT_VAL(STM32_CLOCK_PLLI2S_PLLR);
i2s_clock_init.TIMPresSelection = 0;
i2s_clock_init.RTCClockSelection = 0;

HAL_RCCEx_PeriphCLKConfig(&i2s_clock_init);
Expand Down

0 comments on commit 79b107a

Please sign in to comment.