2020-09-01 12:53 PM
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?
2020-09-01 02:23 PM
Probably just a code generation bug.
The function is there:
Look at your hal_conf file and ensure it's getting included. And ensure the source file is making it to the project.
2020-09-09 10:39 AM
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.
2020-09-10 12:06 PM
> 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.