2018-06-22 09:45 PM
The macro definition in the library file
STM32Cube_FW_F4_V1.0/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h at line 6112has the original definition below:
/** @brief Macro to get the I2S clock source (I2SCLK).
* @retval The clock source can be one of the following values:
* @arg @ref RCC_I2SCLKSOURCE_PLLI2S: PLLI2S clock used as I2S clock source.
* @arg @ref RCC_I2SCLKSOURCE_EXT External clock mapped on the I2S_CKIN pin
* used as I2S clock source
*/
#define __HAL_RCC_GET_I2S_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_I2SSRC)))�?�?�?�?�?�?�?�?
The problem with this macro is that it does never returns neither of the following values:
RCC_I2SCLKSOURCE_PLLI2S
RCC_I2SCLKSOURCE_EXT
This is simply because of the missing shift operation in the macro. The correct form of the macro should be like the following:
#define __HAL_RCC_GET_I2S_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_I2SSRC)) >> RCC_CFGR_I2SSRC_Pos)�?
#stm32 #stm32cube_fw_f4_v1.0 #stm32cube
2018-08-10 09:39 AM
@CubeMX Please create an account for someone responsible for managing or collating issues with the software.