AnsweredAssumed Answered

STM32F091RC backup registers

Question asked by evans.mark.001 on Apr 20, 2016
Hi

I admit I am a complete newbie so please go easy.... :-)
I need to store some variables in the 5 memory locations in the STM32F091RC.  We have the following code:
mark1 = 123;
RTC_HandleTypeDef RtcHandle;
RtcHandle.Instance = RTC;
HAL_PWR_EnableBkUpAccess();
HAL_RTCEx_BKUPWrite(&RtcHandle, RTC_BKP0R, mark1);
HAL_PWR_DisableBkUpAccess();


RTC_HandleTypeDef RtcHandle1;
RtcHandle1.Instance = RTC;


reg1 = HAL_RTCEx_BKUPRead(&RtcHandle1, RTC_BKP0R);


I never see the number written to reg1.  Can you tell me where im going wrong!


Much appreciated!




Mark.

Outcomes