cancel
Showing results for 
Search instead for 
Did you mean: 

Typo in LL_RTC_ALMB_SetDay()

HermannKleier
Associate II

As of STM32Cube_FW_L4_V1.12.0, LL_RTC_ALMB_SetDay() reads:

__STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day)
{
  MODIFY_REG(RTC->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU),
             (((Day & 0xF0U) << (RTC_ALRMBR_DT_Pos - 4U)) | ((Day & 0x0FU) << RTC_ALRMBR_DU_Pos)));
}

However, the first argument of MODIFY_REG shall read

RTCx->ALRMBR

4 REPLIES 4
Roman Jasmann
Associate II

Actually you are right, but there is only one RTC in the STM32L4. So it's not that critical.

HermannKleier
Associate II

What do you mean by “critical�?? It doesn’t compile. Isn’t that critical?

Now that's strange - RTC is defined in the device header (stm32l4NNxx.h) which is included into stm32l4xx.h, that's included into stm32l4xx_ll_rtc.h where the above function is defined.

While IMO the bug *is* a bug, that your code does not compile might have some different reason. Can you please give us more details, e.g the exact error message and the circumstances of compilation?

JW

HermannKleier
Associate II

It’s been more than a year ago. We have see two updates and today 1.14 is the current version. Nothing has changed. Still the documentation (UM 1884) states that the parameter RTCx is an RTC Instance. And still the implementation silently ignores the parameter and uses the global variable RTC instead.