2006-11-11 09:10 PM
2006-11-06 12:09 AM
Hello all.
I use ST10F276, and I would like to protect first 4 Sectors in Bank0(B0F0-3). Is posible? How? I DON'T want to disable any access to the whole Flash due to my application specific. Thank you. Ran Aricha [ This message was edited by: Ran on 06-11-2006 13:57 ]2006-11-07 07:16 PM
Hello,
There are two kinds of protection in the ST10F276: - write protection to avoid unwanted writings - access protection to avoid piracy Write protection can be applied to the Flash sectors individually by clearing WxPy bits(x= bank; y=sector) in Flash Non Volatile Write Protection registers. For example, to enable Write Protection of sectors B0F3-0 of Bank 0 in IFLASH module: FCR0H|= 0x0100; /*Set SPR in FCR0H*/ FARL = 0xDFB4; /*Load Add of register FNVWPIRL in FARL*/ FARH = 0x000E; /*Load Add of register FNVWPIRL in FARH*/ FDR0L = 0xFFF0; /*Load Data in FDR0L*/ FDR0H = 0xFFFF; /*Load Data in FDR0H*/ FCR0H|= 0x8000; /*Operation start*/ Regarding the access protection, it is applied to the whole IFLASH memory (it can not be applied to a sector). For more details, please refer to the ST10F276 datasheet, section 5.5 Protection Strategy, page 36. I hope this helps you, Best regards, Najoua.2006-11-11 09:10 PM
Thank you.
I meant access protection (piracy access). I understood I can't protect 4 Flashs only...(?) Do I need more commands more than: Protection: FCR0H |= 0x0100; /* set protection operation */ FARL = 0xDFB8; /* load FNVAPR0 */ FARH = 0x000E; FDR0L = 0xFFFE; /* DBGP = 1, ACCP = 0 */ FCR0H |= 0x8000; /* operation start */ Unprotection: FCR0H |= 0x0100; /* set protection operation */ FARL = 0xDFB8; /* load FNVAPR0 */ FARH = 0x000E; FDR0L = 0xFFFF; /* DBGP = ACCP = 1 */ FCR0H |= 0x8000; /* operation start */ Thanks in advance... Ran