Skip to main content
gigo
Associate
February 18, 2016
Question

Error while erasing flash ROM

  • February 18, 2016
  • 4 replies
  • 1008 views
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. 
    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    February 18, 2016
    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
    gigoAuthor
    Associate
    February 18, 2016
    Posted on February 18, 2016 at 09:31

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

    pkumar1883
    Associate III
    February 18, 2016
    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*/

         

    Tesla DeLorean
    Guru
    February 18, 2016
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..