Erase Flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Erase Flash

1,284 Views
DavidoBG
Contributor II
My Program contains two sections
A first section for SW application
A second section for Bootloader.
 
So my segment definition is :
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    Z_RAM                    =  READ_WRITE   0x0060 TO 0x00FF;
    RAM                      =  READ_WRITE   0x0100 TO 0x025F;
    ROM                      =  READ_ONLY    0xE000 TO 0xF7AD;
    BOOTLOADER               =  READ_ONLY    0xF800 TO 0xFFBF;
    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFCD;
   
 /* INTVECTS                 =  READ_ONLY    0xFFCE TO 0xFFFF; Reserved for Interrupt Vectors */
END
 
In my bootloader program i have an erase fonction. I would like erase E000->E200. But it is not possible except if i change ROM                      =  READ_ONLY    0xE000 TO 0xF7AD;
to
ROM                      =  READ_ONLY    0xE200 TO 0xF7AD; So i can erase.
But if i change this segment, my applicaztion SW begin @ E200 instead of E000.
 
In fact, i would like erase a page containing efficient informations between E000->E200.
Do you have any idea about my issue?
 
david
Labels (1)
0 Kudos
2 Replies

253 Views
DavidoBG
Contributor II
forget my first post, It OK, issue about refresh memory.
 
But  i have an another question about erase and write flash.
It is mandatory to run erase and write fonction (explain in doonstack.h) in RAM? It is possible to do a same king of function in C and in ROM execution?
 
David
0 Kudos

253 Views
peg
Senior Contributor IV
Hi David,

Yes it is necessary to run from RAM because while the FLASH array has the high voltage connected (for programming) the entire array is inaccessible.
If your device has more than one FLASH array then you may run from the other one.
It is usually implemented in assembler to assist in minimising the amount of RAM required.

We don't go to all this trouble just to amuse ourselves!

0 Kudos