AnsweredAssumed Answered

STM32CubeMX RTC code generation: probably a bug?

Question asked by van_hest.bart on Aug 30, 2015
Latest reply on Sep 1, 2015 by 68516
On the STM32L051 I was trying to use the WKUP1 pin to wake up the processor from standby mode. Too bad I didn't notice the fact that a pulldown is enabled on that pin....

So now I'm trying to play this through the tamper detection of the RTC. I re-generated code with STM32CubeMX, and part of that code is:

/**Enable the RTC Tamper 2
  */
sTamper.Tamper = RTC_TAMPER_2;
sTamper.Trigger = RTC_TAMPERTRIGGER_RISINGEDGE;
sTamper.NoErase = RTC_TAMPER_ERASE_BACKUP_ENABLE;
sTamper.MaskFlag = RTC_TAMPERMASK_FLAG_DISABLE;
sTamper.Filter = RTC_TAMPERFILTER_DISABLE;
sTamper.SamplingFrequency = RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192;
sTamper.PrechargeDuration = RTC_TAMPERPRECHARGEDURATION_1RTCCLK;
sTamper.TamperPullUp = RTC_TAMPER_PULLUP_ENABLE;
sTamper.TimeStampOnTamperDetection = RTC_TIMESTAMPONTAMPERDETECTION_ENABLE;
HAL_RTCEx_SetTamper(&hrtc, &sTamper);

Unfortunately, the RTC_TAMPER_ERASE_BACKUP_ENABLE and RTC_TAMPERMASK_FLAG_DISABLE constants do not exist.

However, what does exist is RTC_TAMPERERASEBACKUP_ENABLED and RTC_MASKTAMPERFLAG_DISABLED.

Looks like a small bug to me?

Outcomes