Skip to main content
BRuiz
Visitor II
February 22, 2019
Solved

Why can't I change any value in the FLASH_OPTR register?

  • February 22, 2019
  • 1 reply
  • 959 views

I am using the STM32L431 MCU and I want to stop the IWDG when it enters the standby mode, so I want to try changing the value of the IWDG_STDBY bit to freeze the IWDG. I tried with any of the the following instuctions but nothing works.

CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_IWDG_STDBY);
FLASH->OPTR &= 0xFFFBFFFF;
(FLASH->OPTR & FLASH_OPTR_IWDG_STDBY) = 0x0;

I'd like to know if before I can change this register, another action must be done.

Thanks!

This topic has been closed for replies.
Best answer by After Forever

You should unlock it. Read the "Option bytes programming" section in the reference manual (RM0394).

Also, what is this?? 0_0

> (FLASH->OPTR & FLASH_OPTR_IWDG_STDBY) = 0x0;

1 reply

After Forever
After ForeverBest answer
Senior III
February 22, 2019

You should unlock it. Read the "Option bytes programming" section in the reference manual (RM0394).

Also, what is this?? 0_0

> (FLASH->OPTR & FLASH_OPTR_IWDG_STDBY) = 0x0;