Yellow warnings can be ignored--they are letting you know of potential conflicts, not active ones. In this case, probably one of the pins for the SMBUS modes is already in use.
"If you feel a post has answered your question, please click ""Accept as Solution""."
Well there are pins assigned to I2C2. Whatever the issue, it doesn't appear to be caused by CubeMX configuration.
I would put a logic analyzer on I2C2, see what happens when you call HAL_I2C_IsDeviceReady functions. If no response, verify pin settings are correct in registers. If those work, you can convince yourself the problem is elsewhere.
"does not work at all" is not descriptive. Stating what result you're seeing vs what you're expected along with any debugging of hardware/software you've already done would be more informative. Include relevant sections of code, show signal traces if possible.
"If you feel a post has answered your question, please click ""Accept as Solution""."