cancel
Showing results for 
Search instead for 
Did you mean: 

Error while erasing flash ROM

gigo
Associate
Posted on February 18, 2016 at 06:56

I am using STM32F427IG microcontroller. The Flash Rom is connected to the FMC Controller.  I am getting error when I tried to erase a sector of flash memory. The error status flags- PGSERR, PGPERR was set. It worked fine when I cleared this error flags and tried again.  

This error exists when I tried to erase again. So everytime, I need to clear the status flag and have to try again. 
4 REPLIES 4
Posted on February 18, 2016 at 09:00

> I am using STM32F427IG microcontroller. The Flash Rom is connected to the FMC Controller.

So, you have an external FLASH connected to the mcu? What kind of it?

> I am getting error when I tried to erase a sector of flash memory. The error status flags- PGSERR, PGPERR was set.

These flags are related to *internal* memory, not to external memory connected through FMC.

JW

gigo
Associate
Posted on February 18, 2016 at 09:31

Sorry, I was wrong.  We are using the internal flash. 

pkumar1883
Associate II
Posted on February 18, 2016 at 11:05

Could you unlock the flash successfully. Not sure about your part number but I think that you cant erase a sector, you only can erase complete page.

So the better way to erase a sector is first read the complete page content. keep that in RAM(buffer). Edit the desired sector location in RAM. Erase the page and write the updated RAM(buffer).

/*Please

 mark helpfull

 if this post helps you or solves your problem.*/

/* If you need any personal support for your work please contact at 

embeddeddesign.help@gmail.com*/

     

Posted on February 18, 2016 at 19:40

You're doing something wrong, what exactly that is is hard to know from your presentation of the problem. Refine your presentation.

Show you code, ideally a sufficiently complete example, that demonstrates the failure.

The erase on the F4 takes a block number, not an address.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..