Skip to main content
Visitor II
June 16, 2005
Question

ST10f168 steak temporary unprotect

  • June 16, 2005
  • 3 replies
  • 923 views
Posted on June 16, 2005 at 12:52

ST10f168 steak temporary unprotect

    This topic has been closed for replies.

    3 replies

    Visitor II
    April 4, 2005
    Posted on April 04, 2005 at 19:11

    hello.

    i have another problem: after activating protection setting the uprog bit i can not write to internal flash anymore. my writing function is located in external RAM and works without protection. To temporary unprotect i write a #0 to adress 0 like

    MOVB RL4,#00h

    MOV R5,#00h

    MOV R10,#00h

    EXTS R10,#01h

    MOVB [R5],RL4

    but after this my steak command returns with ''protection active'' error... (the code above shure is executed in internal flash!)

    Which adresses do i have to set to zero to unprotect the flash temporary?

    kindest regards,

    itsme

    [ This message was edited by: itsme on 04-04-2005 22:43 ]

    Visitor II
    April 5, 2005
    Posted on April 05, 2005 at 08:05

    1.

    is it necessary to deprotect ST10F168 temporary to use the SFR ZEROS or is it enough to write a zero VALUE to an even address?

    2.

    Is a MOVB also ok or DO i need a WORD-Instruction MOV ?

    3.

    Is it possible to use indirect adressing or DO i need DIRECT ADRESSING?

    I protect two mcu until now with missing right deprotection in internal flash. is there a way to deprotect (temporary) in another way or erase whole internal flash and protection bit or can i throw them to the ''waste-can''?!

    [ Diese Nachricht wurde editiert von : itsme on 05-04-2005 12:34 ]

    Visitor II
    June 16, 2005
    Posted on June 16, 2005 at 12:52

    No, it seems that it MUST be the ZEROS register!

    Anyway, nevertheless i have problems with unprotection. If i run a program in internfal flash like:

    exts #3,#1

    mov 08000h,ZEROS

    [...]

    copy some flash functions to memory

    [...]

    calls _erasepage (located in memory)

    this works fine and the page is erased.

    if i locate following procedure in internal flash and call it from external memory it does not work... curious...

    example iflash:

    org 038000H

    exts #3,#1

    mov 08000h,ZEROS

    rets

    external memory:

    calls seg _038000, sof 38000h ; unprotect

    ..erasepage...

    errorcode: flash protected...

    ?! How is this possible...

    There are things between zero and one i do not understand... ;)