Check and manipulate with CR1 only in master mode.
Compiled code.
Debugging I2C. It doesn't work. It (either master, slave or both) keeps SCL line low.