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
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