Programming the STM32F10x via I2C with this app note from STMicroelectronics
A key requirement for most Flash-memory-based systems is the ability to update firmware once the system is installed in the end product. This is referred to as in-application programming (IAP).
This application note describes how to perform in-application programming using the STM32F10x’s I2C peripheral. An USB-I2C bridge is required to send IAP commands to the target STM32F10x. The STM32F10x behaves as an I2C memory that can be programmed, erased and read via the I2C/ interface.