2006-11-21 09:40 PM
ST10F269 problem to erase flash block with protection
2006-11-21 12:15 AM
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 thanks2006-11-21 09:40 PM
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.