I am trying to get FLASH programming & erasing working. I have successfully got the ST Flash example program to work. I have my own RCC clock setup. When I use that, the flash does not program properly. Since I'm not using the ST library, I've turned off the HSI oscillator (since I've got an external crystal). If I disable HSI, flash programming doesn't work. If I enable HSI, it does! I can't seem to find it in the manuals, but I assume the HSI clock is used for programming the flash? Is this correct? Thanx.
I have also the same pb :( anyone could help us to understand how the flash is clocked when programming ? It seems that the charge pump is using the internal RC (HSI). Thanks , Asterix.
I was looking at the example code under the flash section I could not see where we enable the HSI oscillator. In the function void RCC_Configuration(void) I could see how we enable the HSE oscillator not HSI.
In my code, I'm accessing the RCC Control register directly. The HSI is bit 0. Not using the libraries, but here's my code: #define STM32_RCC_CR_HSION 1 //Turn on the internal oscillator RCC->CR = RCC->CR | STM32_RCC_CR_HSION; Hope this helps. :)