STM32_CECSW enforces HSI or LSE enabled even if not used

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

Moderator: RoccoMarco

Post Reply
ulikoehler
Posts: 71
Joined: Tue Mar 17, 2015 2:32 am
Been thanked: 3 times

STM32_CECSW enforces HSI or LSE enabled even if not used

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

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

Post 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
Post Reply