cancel
Showing results for 
Search instead for 
Did you mean: 

FLASH programming

stuart2399
Associate II
Posted on March 07, 2008 at 13:47

FLASH programming

8 REPLIES 8
asterix
Associate II
Posted on May 17, 2011 at 12:25

Hi wobble, STOne-32

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.

stuart2399
Associate II
Posted on May 17, 2011 at 12:25

Dear All,

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.

16-32micros
Associate III
Posted on May 17, 2011 at 12:25

Dear asterix, wobble,

You are right and this information is already mentioned in Flash programming manual PM0042: Page 9/31. It is more clear now ? 🙂

Cheers,

STOne-32

stuart2399
Associate II
Posted on May 17, 2011 at 12:25

Thanks ST-One, I missed that!

smart
Associate II
Posted on May 17, 2011 at 12:25

where do we enable the HSI oscillator.

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.

stuart2399
Associate II
Posted on May 17, 2011 at 12:25

Hi smart.avr

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.

🙂

lanchon
Associate II
Posted on May 17, 2011 at 12:25

@smart.avr,

haven't seen the example you mention, but I believe the HSI will be enabled unless you specifically turn it off.

smart
Associate II
Posted on May 17, 2011 at 12:25

if you download the ARM-based 32-bit MCU STM32F101xx and STM32F103xx firmware library under that you will get the UM0427 Zip file.

Over there you can find out the 2 example code under the flash section.