Flasher PORTABLE Unsecure chip in stand-alone mode. STM32F205

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Flasher PORTABLE Unsecure chip in stand-alone mode. STM32F205

    Hello.

    J-Flash User Guide (UM08003)


    7.6.4 STM32F4 series devices - option byte programming. example project for the STM32F405OE



    It's ok if the microcontroller is blank.

    If the microcontroller is already programmed and protected it does not work.

    Flash option control register (FLASH_OPTCR)

    nWRP: Not write protect
    = PROTECTED
    RDP: Read protect
    = Level 1, read protection of memories active.

    Init steps ????

    " ExitStep0_Action = "Read 32bit"
    ExitStep0_Comment = "Read OPTCR"
    ExitStep0_Value0 = 0x40023C14
    ExitStep0_Value1 = 0x00000000
    ExitStep1_Action = "Var AND"
    ExitStep1_Comment = ""
    ExitStep1_Value0 = 0x00000000
    ExitStep1_Value1 = 0x00000001
    ExitStep2_Action = "Var BEQ"
    ExitStep2_Comment = "Skip unlock of OPTCR if not locked"
    ExitStep2_Value0 = 0x00000005
    ExitStep2_Value1 = 0x00000000
    ExitStep3_Action = "Write 32bit"
    ExitStep3_Comment = "OPTKEYR: Unlock key 1"
    ExitStep3_Value0 = 0x40023C08
    ExitStep3_Value1 = 0x08192A3B
    ExitStep4_Action = "Write 32bit"
    ExitStep4_Comment = "OPTKEYR: Unlock key 2"
    ExitStep4_Value0 = 0x40023C08
    ExitStep4_Value1 = 0x4C5D6E7F
    ExitStep5_Action = "Write 32bit"
    ExitStep5_Comment = "OPTCR: Write option byte values"
    ExitStep5_Value0 = 0x40023C14
    ExitStep5_Value1 = 0x0FFFAAEC
    ExitStep6_Action = "Read 32bit"
    ExitStep6_Comment = "OPTCR"
    ExitStep6_Value0 = 0x40023C14
    ExitStep6_Value1 = 0x00000000
    ExitStep7_Action = "Var OR"
    ExitStep7_Comment = "OPTCR[1:1] starts option byte programming"
    ExitStep7_Value0 = 0x00000000
    ExitStep7_Value1 = 0x00000002
    ExitStep8_Action = "Var Write 32bit"
    ExitStep8_Comment = ""
    ExitStep8_Value0 = 0x40023C14
    ExitStep8_Value1 = 0x00000000
    ExitStep9_Action = "Read 32bit"
    ExitStep9_Comment = "FLASH_SR"
    ExitStep9_Value0 = 0x40023C0C
    ExitStep9_Value1 = 0x00000000
    ExitStep10_Action = "Var AND"
    ExitStep10_Comment = "Wait until flash controller is no longer busy"
    ExitStep10_Value0 = 0x00000000
    ExitStep10_Value1 = 0x00010000
    ExitStep11_Action = "Var BNE"
    ExitStep11_Comment = ""
    ExitStep11_Value0 = 0x00000009
    ExitStep11_Value1 = 0x00000000
    " don't work.

    Is there any example of this?


    Best regards
    Jokin
  • Hi,

    J-Flash comes with an example Project which contains the init steps necessary to unlock the STM32F4.
    It is also linked in the wiki: wiki.segger.com/STM32F4

    Do I understand you correctly that you need an example for the STM32F2?


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi.

    Thanks for replying so quickly. I think I did not explain my problem well.
    example Project
    INIT STEPS
    ACTION RESET halt target
    EXIT STEPS
    ACTIONS READOPTCR.........

    This example works fine on a microcontroller is blank and option bytes ( no sector protection, no secure chip),

    but if you are re-programming a previously programmed microcontroller with ( any sector protected or secure chip) it fails.

    I tried to change the sequence in init steps and reset the OPTCR to its default value but it did not work.
    Do you know any examples of this?

    Best regards