Skip to main content
Gahlen Feld
Associate III
June 13, 2017
Solved

How to persistently write into option byte BOOT_ADD0/1

  • June 13, 2017
  • 3 replies
  • 1778 views
Posted on June 13, 2017 at 14:12

Hello,

when reading out FLASH_OPTCR1 register I get boot addresses 0x00200000 and 0x00100000 for BOOT_ADD0 and BOOT_ADD1.

Now I am doing the option byte unlock procedure and the OPTLOCK-bit in FLASH_OPTCR is cleared to 0.

Then I write a new boot address for BOOT_ADD0 and lock the option byte by setting OPTLOCK-bit in FLASH_OPTCR.

When reading out FLASH_OPTCR1 I get the new boot address for BOOT_ADD0 (and the old for BOOT_ADD1).

But when I reset the MCU, my change to the BOOT_ADD0 is not persistently saved but the original value is retained.

What is the right procedure to store the boot addresses persistently?

Tank you in advance,

Gahlen.

#persistent #option-bytes #boot_add0
This topic has been closed for replies.
Best answer by Uwe Bonnes
Posted on June 13, 2017 at 16:30

I miss FLASH_OPTCR_OPTSTRT getting set to initiate programming. Reread the reference manual.

3 replies

Uwe Bonnes
Uwe BonnesBest answer
Chief
June 13, 2017
Posted on June 13, 2017 at 16:30

I miss FLASH_OPTCR_OPTSTRT getting set to initiate programming. Reread the reference manual.

Gahlen Feld
Associate III
June 13, 2017
Posted on June 13, 2017 at 17:07

this sounds good, I will try it tomorrow morning and yes, I will also read the reference manual (obviously I missed this section when reading it)