I am studing I2C protocol and I want to implement it with the STM32 microcontroller. So reading the documentation file I show an initialization flowchart of I2C that it recomends for a software reset at the beginning (after we make the starter init settings). I have read about a refernce in doc for software reset but I cant make it clear on my mind why we need a software reset.
You haven't specified the exact part you are using, but for many STM32, the I2C peripheral monitors the bus whenever it is clocked by the RCC. If during your power-on sequence the state of the I2C bus is not well defined, then the I2C peripheral may see what it perceives to be bus activity. It then monitors the bus looking for a stop sequence. If you instruct it to make a start sequence while it still thinks the bus is busy it will refuse.
The purpose of the software reset is to not only reset the registers to their default values, but to get the state that the peripheral thinks the bus is in back to idle.