Skip to content

Commit 71ba2de

Browse files
aviscontigalak
authored andcommitted
ext: stm32cube: stm32f4xx: shift I2SR field in PLLI2SCFGR register
The I2SR field should be shifted by RCC_PLLI2SCFGR_PLLI2SR_Pos when the PLLI2SCFGR register is read or written. Without this patch the PLLI2S configuration is not done properly (R and M params are badly set) and the PLLI2S generates bad clock waveform. ST Bug tracker ID: 50086 Signed-off-by: Armando Visconti <[email protected]>
1 parent f5ec567 commit 71ba2de

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ext/hal/st/stm32cube/stm32f4xx/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,10 @@ Patch List:
4343
Impacted files:
4444
drivers/include/stm32f4xx_hal_conf.h
4545
ST Bug tracker ID: NA. Not a stm32cube issue
46+
47+
*Add correct shifting to I2SR field in PLLI2SCFGR register
48+
The I2SR field should be shifted by RCC_PLLI2SCFGR_PLLI2SR_Pos when the PLLI2SCFGR register
49+
is read or written.
50+
Impacted files:
51+
drivers/include/stm32f4xx_ll_rcc.h
52+
ST Bug tracker ID: 50086

ext/hal/st/stm32cube/stm32f4xx/drivers/include/stm32f4xx_ll_rcc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5685,7 +5685,7 @@ __STATIC_INLINE void LL_RCC_PLLI2S_ConfigDomain_I2S(uint32_t Source, uint32_t PL
56855685
#else
56865686
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLM, PLLM);
56875687
#endif /* RCC_PLLI2SCFGR_PLLI2SM */
5688-
MODIFY_REG(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN | RCC_PLLI2SCFGR_PLLI2SR, PLLN << RCC_PLLI2SCFGR_PLLI2SN_Pos | PLLR);
5688+
MODIFY_REG(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SN | RCC_PLLI2SCFGR_PLLI2SR, PLLN << RCC_PLLI2SCFGR_PLLI2SN_Pos | PLLR << RCC_PLLI2SCFGR_PLLI2SR_Pos);
56895689
}
56905690

56915691
/**
@@ -5740,7 +5740,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetQ(void)
57405740
*/
57415741
__STATIC_INLINE uint32_t LL_RCC_PLLI2S_GetR(void)
57425742
{
5743-
return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SR));
5743+
return (uint32_t)(READ_BIT(RCC->PLLI2SCFGR, RCC_PLLI2SCFGR_PLLI2SR) >> RCC_PLLI2SCFGR_PLLI2SR_Pos);
57445744
}
57455745

57465746
#if defined(RCC_PLLI2SCFGR_PLLI2SP)

0 commit comments

Comments
 (0)