Page 1 of 1

STM32_CECSW enforces HSI or LSE enabled even if not used

Posted: Thu Aug 06, 2015 11:12 pm
by ulikoehler
Hi,
if I use a mcuconf.h similar to this (excerpt):

Code: Select all

#define STM32_HSI_ENABLED                   FALSE
#define STM32_HSE_ENABLED                   TRUE
#define STM32_LSE_ENABLED                   FALSE
#define STM32_CECSW                         STM32_CECSW_HSI


ChibiOS 3.x (HAL: current SVN) prints this error:

Code: Select all

#error "HSI not enabled, required by STM32_CECSW"


Neither do I use CEC nor does my STM32F030x support it at all. The only options for CECSW are STM32_CECSW_HSI and STM32_CECSW_LSE, therefore either HSI oder LSE would have to be enabled which might not be the case for a low-power application.

What is the recommended method of disabling CEC so neither of those clocks need to be active?
Ad hoc, I could think of using

Code: Select all

#define STM32_CECSW                         0xFF //Neither STM32_CECSW_HSI nor STM32_CECSW_LSE

but I think it is not advisable to do that because it might get ORed into some register we don't want to modify.

Best regards, Uli

Re: STM32_CECSW enforces HSI or LSE enabled even if not used

Posted: Fri Aug 07, 2015 10:36 am
by Giovanni
Hi,

Using those pseudo-constants is what I did in other ports (I used 0xFFFFFFFF), of course making sure it is never actually ORed to the register value.

I added a similar fix to the F0, marked as bug #628.

Giovanni