cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling access to backup registers

peterpeter9163
Associate
Posted on April 22, 2016 at 10:40

I am using the STM32F091RC with the HAL libraries.

I am trying to gain access to the backup registers and I am trying:

PWR->CR |= 0x100;

to set bit 8.  However it will not change the bit as though I am blocked out and it remains 0.  I have tried calling HAL_PWR_EnableBkUpAccess(); but the bit still remains off.  Any help would be really appreciated!

thank you!
1 REPLY 1
Walid FTITI_O
Senior II
Posted on April 22, 2016 at 11:14

Hi evans.mark.001,

Make sure that you have already enabled the PWR peripheral using __PWT_CLK_ENABLE(); before allowing access to backup domain.

/* Enable Power Clock */ 
__PWR_CLK_ENABLE(); 
/* Allow Access to RTC Backup domaine */ 
HAL_PWR_EnableBkUpAccess();

You can refer to examples in

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612

at this path :stm32cubef0\STM32Cube_FW_F0_V1.2.0\Projects\STM32091C_EVAL\Examples\PWR -Hannibal-