cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F74XX I2C Fast-Mode Plus Configuration

LMend.1
Associate II

According to the the STM32F74XXX Reference Manual, the STM32F74XX supports Fast-mode Plus I2C (up to 1MHz).

I have configured my application's I2C to Fast-Mode Plus through STM32CubeIDE tools but I get the following error during build time: undefined reference to `HAL_I2CEx_EnableFastModePlus' that points to the generated line of code in main.c :  

/** I2C Enable Fast Mode Plus

 */

 HAL_I2CEx_EnableFastModePlus(I2C_FASTMODEPLUS_I2C1);

I do not get that error if the I2C is configured to 400KHz through the same method.

What is that I am missing?

3 REPLIES 3
TDK
Guru

Probably just a code generation bug.

The function is there:

https://github.com/STMicroelectronics/STM32CubeF7/blob/3600603267ebc7da619f50542e99bbdfd7e35f4a/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c_ex.c

Look at your hal_conf file and ensure it's getting included. And ensure the source file is making it to the project.

If you feel a post has answered your question, please click "Accept as Solution".
LMend.1
Associate II

Thanks for the prompt response TDK.

The file stm32f7xx_hal_i2c_ex.c is listed in my project's Drivers folder under SM32F7xx_HAL_Driver/Src. But just in case I added this path to my project Properties' Paths and Symbols at Includes - C/C++ General . The build error is still present.

Line 181 of the mentioned stm32f7xx_hal_i2c_ex.c conditions the execution of void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus) to:

#if (defined(SYSCFG_PMC_I2C_PB6_FMP) || defined(SYSCFG_PMC_I2C_PB7_FMP)) || (defined(SYSCFG_PMC_I2C_PB8_FMP) || defined(SYSCFG_PMC_I2C_PB9_FMP)) || (defined(SYSCFG_PMC_I2C1_FMP)) || (defined(SYSCFG_PMC_I2C2_FMP)) || defined(SYSCFG_PMC_I2C3_FMP) || defined(SYSCFG_PMC_I2C4_FMP)

I am wondering if STM32CubeIDE is configuring PB8 and 9 accordingly, unfortunately I do not know where to look for these SYSCFG_PMC_I2C_PB8_FMP & SYSCFG_PMC_I2C_PB9_FMP definitions.

I am using Version: 1.4.2 of STM32CubeIDE and Version: 6.0.1-RC3 of STM32CubeMX - STM32 Device Configuration Tool.

TDK
Guru

> I do not know where to look for these SYSCFG_PMC_I2C_PB8_FMP & SYSCFG_PMC_I2C_PB9_FMP definitions.

With your cursor on the word, you can hit F3 (or maybe F12 by default?) to jump to the definition. If your project is set up correctly, this usually works.

You can also just do a file search all files for what you're looking for (Search --> File...).

Another option is searching the online repository if you don't have a project set up.

https://github.com/STMicroelectronics/STM32CubeF7/search?q=SYSCFG_PMC_I2C_PB8_FMP&unscoped_q=SYSCFG_PMC_I2C_PB8_FMP

If you feel a post has answered your question, please click "Accept as Solution".