Skip to main content
Martijn Jonkers
Associate III
March 24, 2016
Question

why would SetSysClock enable the HSE for stm32L1x

  • March 24, 2016
  • 2 replies
  • 648 views
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?
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    March 24, 2016
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Martijn Jonkers
    Associate III
    March 24, 2016
    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. ;)