cancel
Showing results for 
Search instead for 
Did you mean: 

why would SetSysClock enable the HSE for stm32L1x

Martijn Jonkers
Associate II
Posted on March 24, 2016 at 21:46

I am developing a low power application for the stm32L151RC and after a lot of debugging noticed that the system_stm32l1xx.c file does a  

RCC->CR |= ((uint32_t)RCC_CR_HSEON);

Why would it do that. Why not just continue with the MSI at 2 MHz?

Now my application consumes to much power during sleep mode (1.64 mA instead of 150uA).

I know I can simply alter the systemInit function, but why does it do this in the first place?
2 REPLIES 2
Posted on March 24, 2016 at 22:11

The system_stm32l1xx.c is expected to be modified to suit the board/application.

Perhaps the availability of a faster more accurate clock was desirable for the applications they had in mind? CAN or USB perhaps?

Trying to understand ''why'' ST does certain things will just give you a headache, I'd recommend you figure what it is you want to do, and then do that thing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Martijn Jonkers
Associate II
Posted on March 24, 2016 at 22:18

Ah, my mistake.

I was used to MCU's designed for low power actually being used for low power applications. ;)