cancel
Showing results for 
Search instead for 
Did you mean: 

ST10F269 problem to erase flash block with protection

info89
Associate
Posted on November 22, 2006 at 06:40

ST10F269 problem to erase flash block with protection

2 REPLIES 2
info89
Associate
Posted on November 21, 2006 at 09:15

Hello together,

I have put my boot routines in the internal flash block 0. The application is stored in block 4. The flash is code protected and block 0 is block protected. The boot routines are capable to load the application to block 4.

Now I want to change the boot routines in block 0. I wrote a special application which erases block 0 and then copies the routines to block 0. I tested this application with a controler with a non protected flash and block 0 respectivly. It works ok.

But with a controller which flash ist protected it doesn't erases block 0, although i implemented the BTU and CTU command.

Block erasing is done in following steps:

1. copy the BTU function in RAM

2. execute CTU command from flash

3. execute BTU command from RAM

4. copy erase function in RAM

5. execute CTU command from flash

6. execute erase function from RAM

What have I done wrong? Can anybody help me?

Many thanks

najoua
Associate II
Posted on November 22, 2006 at 06:40

Hello vowa,

The following sequence is working in order to temporary unprotect the flash when both code and block protection are set:

1/ Copy in RAM

- The program and erase functions of the flash

- The code for block temporary un-protection

2/ Jump to RAM and execute the BTU

3/ Jump to flash and execute the Code Temporary Un-protection (CTU)

4/ Go back to RAM and perform your program and erase operations.

This sequence was given on the STMCU web site on the following link:

http://mcu.st.com/mcu/modules.php?mop=modload&name=Splatt_Forums&file=viewtopic&topic=2224&forum=5

You can also find CTU and BTU program examples in this discussion.

I hope this helps you,

Best regards,

Najoua.