Skip to main content
Graduate
January 2, 2020
Question

Value definitions in generated file stm32f4xx_hal_rtc.h are incorrect

  • January 2, 2020
  • 1 reply
  • 1312 views

Hello, team!

In the stm32f4xx_hal_rtc.h header, the values for the months are set incorrectly

/* Coded in BCD format */

#define RTC_MONTH_JANUARY             ((uint8_t)0x01)

#define RTC_MONTH_FEBRUARY            ((uint8_t)0x02)

#define RTC_MONTH_MARCH               ((uint8_t)0x03)

#define RTC_MONTH_APRIL               ((uint8_t)0x04)

#define RTC_MONTH_MAY                 ((uint8_t)0x05)

#define RTC_MONTH_JUNE                ((uint8_t)0x06)

#define RTC_MONTH_JULY                ((uint8_t)0x07)

#define RTC_MONTH_AUGUST              ((uint8_t)0x08)

#define RTC_MONTH_SEPTEMBER           ((uint8_t)0x09)

#define RTC_MONTH_OCTOBER             ((uint8_t)0x10) --> in decimal, this is 16

#define RTC_MONTH_NOVEMBER            ((uint8_t)0x11) --> in decimal, this is 17

#define RTC_MONTH_DECEMBER            ((uint8_t)0x12) --> in decimal, this is 18

The last three, shall be 0x0A, 0x0B, 0x0C in this order.

Can you please fix this?

    This topic has been closed for replies.

    1 reply

    Super User
    January 2, 2020
    OmcseszAuthor
    Graduate
    January 2, 2020

    Yes, this is exactly the same question.

    Graduate II
    January 2, 2020

    /* Coded in BCD format */ not an error. The RTC has few transistors as it doesn't need to handle humans with their decimals.