cancel
Showing results for 
Search instead for 
Did you mean: 

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

BRuiz
Associate

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!

1 ACCEPTED SOLUTION

Accepted Solutions

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;

View solution in original post

1 REPLY 1

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;