Page 1 of 1

Possible bug in RTC clock handling logic

Posted: Mon Apr 13, 2015 9:15 pm
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?

Re: Possible bug in RTC clock handling logic

Posted: Mon Apr 13, 2015 9:27 pm
by Giovanni
Hi,

I will give it a try tomorrow.

Giovanni

Re: Possible bug in RTC clock handling logic

Posted: Fri Apr 17, 2015 10:39 am
by Giovanni
Hi,

Committed a fix in 2.6.8 and 3.0.0p4.

Giovanni

Re: Possible bug in RTC clock handling logic

Posted: Sun Apr 19, 2015 10:39 pm
by dflogeras
Thanks! Works here, and the new logic caught a few of my projects that were previously misconfigured.