Closed leodicarpaccio closed 1 year ago
Hi @leodicarpaccio,
First, thank you for your contribution.
The first point, the value of RCC_CFGR_I2SSRC
must be 0x00000001 and not 0x00800000. Indeed, the purpose of this value is to set the bit RCC_CFGR_I2SSRC
through the macro __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT)
.
Hence, The value #define RCC_I2SCLKSOURCE_EXT 0x00000001U
is defined for a specific use purpose and is not the bit definition of RCC_CFGR_I2SSRC
.
I tested this macro __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT)
with both proposals (0x00000001, 0x00800000) and checked that the bit RCC_CFGR_I2SSRC
is only set when RCC_I2SCLKSOURCE_EXT is 0x00000001U
The second point, I think that you are confused between the Reference manual [(STM32F405/415, STM32F407/417, STM32F427/437) and STM32F429/439]
(https://www.st.com/content/ccc/resource/technical/document/reference_manual/3d/6d/5a/66/b4/99/40/d4/DM00031020.pdf/files/DM00031020.pdf/jcr:content/translations/en.DM00031020.pdf)) and (STM32F410)
In the first one it’s true that the I2SSCR bit is configured in RCC_CFGR register
But in STM32F410 is configured in RCC_DCKCFGR
With regards,
Hello @RJMSTM,
Thanks for your detailed description but there is something I didn't get. As it is in stm32f4xx_hal_rcc_ex.c, many times the macro __HAL_RCC_GET_I2S_SOURCE() is called. The macro returned one of these values :
But just after this macro call, these values are compared directly with :
So for STM32F405/415/407/417/427/437/429/439 there is obviously a bug when comparing to RCC_I2SCLKSOURCE_EXT. Regards
Hello,
Any update about this bug ? Please check my previous message.
Regards
Hello @leodicarpaccio Sorry for my tardy reply. I'm still investigating, I will back to you in the next few days.
BeST Regards, Rania
Hello,
You can stop investigating : it have been corrected in the meantime by someone else the 2nd February, following my suggestion.
Regards,
Fixed in commit 08d0be9e82e0348566cbefc55f567ffeb297c3c4
The issue is really simple : in stm32f4xx_hal_rcc_ex.h, the value of RCC_I2SCLKSOURCE_EXT is wrong.
In stm32f4xx_hal_rcc_ex.c, this issue creates bugs everywhere __HAL_RCC_GET_I2S_SOURCE() is called and returned value compared to RCC_I2SCLKSOURCE_EXT