2014-03-13 02:51 PM
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...2014-03-13 03:28 PM
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.c2014-03-14 04:07 PM
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.2014-03-14 04:32 PM
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
*-----------------------------------------------------------------------------