Possible bug in RTC clock handling logic

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Possible bug in RTC clock handling logic

Post by dflogeras »

Hi, STM32L1xx project using Chibi-2.6.7.

I am creating a custom board.mk/c/h for my own hardware, starting with the STM32L-DISCOVERY as a template. My board does not use external oscillators, so I have the following in mcuconf.h

Code: Select all

#define STM32_HSI_ENABLED                   TRUE
#define STM32_LSI_ENABLED                   TRUE
#define STM32_HSE_ENABLED                   FALSE
#define STM32_LSE_ENABLED                   FALSE
...
#define STM32_RTCSEL                        STM32_RTCSEL_NOCLOCK


That works fine, but then in my board.h, I've changed the following:

Code: Select all

#if !defined(STM32_LSECLK)
#define STM32_LSECLK                0
#endif

#if !defined(STM32_HSECLK)
#define STM32_HSECLK                0
#endif


But when I compile I get:

Code: Select all

In file included from ../os/hal/include/hal.h:43:0,
                 from ../os/hal/src/hal.c:37:
../os/hal/platforms/STM32L1xx/hal_lld.h:556:2: error: #error "required LSE clock is not enabled"
 #error "required LSE clock is not enabled"
  ^
../os/ports/GCC/ARMCMx/rules.mk:183: recipe for target 'build/obj/hal.o' failed
make: *** [build/obj/hal.o] Error 1


Which makes me think it is ignoring my choice of STM32_RTCSEL. It does the same, if I set it to STM32_RTCSEL_LSI

Any ideas?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Possible bug in RTC clock handling logic

Post by Giovanni »

Hi,

I will give it a try tomorrow.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Possible bug in RTC clock handling logic

Post by Giovanni »

Hi,

Committed a fix in 2.6.8 and 3.0.0p4.

Giovanni
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Possible bug in RTC clock handling logic

Post by dflogeras »

Thanks! Works here, and the new logic caught a few of my projects that were previously misconfigured.
Post Reply