STM32CubeMX 6.5.0 includes code for I2C when not being used.
I think I spotted a bug in CubeMX.
Target processor STM32F767ZIT6. Firmware for F7 package 1.16.2.
I don't tend to use I2C (it's a terrible hack), so I was surprised when I saw that I had stm32f7xx_hal_i2c.c and stm32f7xx_hal_i2c_ex.c showing in my map file.
I checked my Cube model and all I2C devices were disabled, and yet Cube was throwing the I2C support code into my Drivers/STM32F7xx_HAL_Driver/Src and Inc folders. Everything else is accounted for, but I2C??? no thanks.
In stm32f7xx_hal_conf.h, I2C is enabled too. If I comment that out and delete the i2c.c files, my project still compiles.
A flag from a previous time that didn't get cleared? Not likely, I stay away from I2C for my mental health.
Extra cruft.
Thanks,
Andrei (from The Great White (as in snow) North)