Question
STM32L - can't change Brownout level
Posted on January 26, 2015 at 11:25
Hey there,
today i wanted to change the brownout level from 1 to 4, but i failed. I'm using the STM32L151VDT6 and the following code at startupif
((FLASH_OB_GetBOR() & 0x0F) != OB_BOR_LEVEL4){
/* Unlocks the option bytes block access */
FLASH_OB_Unlock();
/* Clears the FLASH pending flags */
FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR |
FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | FLASH_FLAG_OPTVERR);
/* Select The Desired V(BOR) Level------------------------*/
FLASH_OB_BORConfig(OB_BOR_LEVEL4);
/* Launch the option byte loading and generate a System Reset */
FLASH_OB_Launch();
}
It seems that i cannot change the BOR level this way so i tried the ST-Link Utility in which i can access the Option Bytes, too. Result: ''Could not set Option bytes''
In the description of the controller i found this:
''Low power, ultrasafe BOR (brownout reset) with 5 selectable thresholds''
but in reference manual in section ''Status register'' i found at the end of the ''User option byte'' the note ''These bits are read only''... so now i'am a little #confused
Is it possible to change the brownout level or not?
If possible, what am i doing wrong? #help
#stm32l #brownout-level #brownout