cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152 clock speed

peterd
Associate II
Posted on March 13, 2014 at 22:51

The STM32L152 is not running at 32MHz clock speed. Flash has set to 1 wait.

I have controlled the sysclock frequency - the PLL is working. If I change the divider to 24 MHz the cpu is running. The Vcore is set to 1.8V... 
3 REPLIES 3
Posted on March 13, 2014 at 23:28

Ok, should we guess what's wrong? Are you using a board we should be familiar with? What oscillator are you using as a source? What tools are you using? Have you measured internal clocks using the MCO (PA8) pin? How are you making this determination?

What if you use the stock system_stm32L1xx.c file?

STM32L1xx_StdPeriph_Lib_V1.2.0\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
peterd
Associate II
Posted on March 15, 2014 at 00:07

I'm using the STm32nucleo L152 board. mbed (arm) compiler, cmsis driver.

I'm using stm32L1xx_rcc.c from 31.1.14.

I have monitored the pll clock via the MCO pin. Clock is ok. If i use the AHB prescaler to divide the 32MHz pll clock : 2 the cpu is running at 16 MHz. If I use the pll for 24MHz clock the cpu is running without AHB prescaler at 24MHz. I have also tried to use APB1 and APB2 prescaler to scale down the peripherals clocks ... ?

HSI and HSE - cpu is working only to 24MHz. 

Posted on March 15, 2014 at 00:32

Why are you using an AHB divider?

Here's what is in the system_stm32l1xx.c I cited is using.

*=============================================================================
* System Clock Configuration
*=============================================================================
* System Clock source | PLL(HSE)
*-----------------------------------------------------------------------------
* SYSCLK | 32000000 Hz
*-----------------------------------------------------------------------------
* HCLK | 32000000 Hz
*-----------------------------------------------------------------------------
* AHB Prescaler | 1
*-----------------------------------------------------------------------------
* APB1 Prescaler | 1
*-----------------------------------------------------------------------------
* APB2 Prescaler | 1
*-----------------------------------------------------------------------------
* HSE Frequency | 8000000 Hz
*-----------------------------------------------------------------------------
* PLL DIV | 3
*-----------------------------------------------------------------------------
* PLL MUL | 12
*-----------------------------------------------------------------------------
* VDD | 3.3 V
*-----------------------------------------------------------------------------
* Vcore | 1.8 V (Range 1)
*-----------------------------------------------------------------------------
* Flash Latency | 1 WS
*-----------------------------------------------------------------------------
* SDIO clock (SDIOCLK) | 48000000 Hz
*-----------------------------------------------------------------------------
* Require 48MHz for USB clock | Disabled
*-----------------------------------------------------------------------------

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..