Skip to main content
Visitor II
November 12, 2006
Question

Protect 4 Flashs in IFlash

  • November 12, 2006
  • 3 replies
  • 708 views
Posted on November 12, 2006 at 06:10

Protect 4 Flashs in IFlash

    This topic has been closed for replies.

    3 replies

    ranaAuthor
    Visitor II
    November 6, 2006
    Posted on November 06, 2006 at 09:09

    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 ]

    Visitor II
    November 8, 2006
    Posted on November 08, 2006 at 04:16

    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.

    ranaAuthor
    Visitor II
    November 12, 2006
    Posted on November 12, 2006 at 06:10

    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