BUG in stm32f4xx_hal_rcc_ex.h
In function
uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk)
string
/* Get the current I2S source */
srcclk = __HAL_RCC_GET_I2S_SOURCE();
must be
/* Get the current I2S source */
srcclk = __HAL_RCC_GET_I2S_SOURCE() ? RCC_I2SCLKSOURCE_EXT : RCC_I2SCLKSOURCE_PLLI2S;
because __HAL_RCC_GET_I2S_SOURCE() return RCC_CFGR_I2SSRC_Msk if bit RCC_CFGR_I2SSRC is set. But need RCC_I2SCLKSOURCE_EXT or RCC_I2SCLKSOURCE_PLLI2S in next
switch (srcclk)
{
/* Check if I2S clock selection is External clock mapped on the I2S_CKIN pin used as I2S clock */
case RCC_I2SCLKSOURCE_EXT:
...
case RCC_I2SCLKSOURCE_PLLI2S:
...
