Skip to main content
ameno12008
Associate
November 14, 2012
Question

STM32l152-VB _Start up

  • November 14, 2012
  • 5 replies
  • 1287 views
Posted on November 14, 2012 at 11:40

Hello,

i need help

When debugging my code ,,there is an infinite loop at start up section,,,although i did all clk configuration

For example

@file    system_stm32l1xx.c

  /* Wait till HSE is ready and if Time out is reached exit */

  do

  {

    HSEStatus = RCC->CR & RCC_CR_HSERDY;

    StartUpCounter++;

  } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));

Is there any opinion for solving this problem?...

Thanks in advance 

#clive1
    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    November 14, 2012
    Posted on November 14, 2012 at 17:04

    Do you have an external crystal, and is it starting?

    If it's not starting you'd need to review the component choices, and perhaps the STM32 crystal app note.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ameno12008
    Associate
    November 17, 2012
    Posted on November 17, 2012 at 14:19

    thank you for your support

    paolo239955_stm1_stmicro_com
    Associate
    November 22, 2012
    Posted on November 22, 2012 at 11:49

    I have a similar problem with STM32L152xx

    Configuration:

    Clock source: MSI

    freq.: all MSI freq. (64KHz to 4MHz)

    Procedure

    - Power on

    - the device NOT start...

    - manually reset (NRST to GND for ~1 sec  -  from one to three attempts)

    - the device start...

    Very simple test firmware (schematic):

    {

    [power-on]

    SetSysClock();

    ConfigurePortAPin13ForToggle();

    while(1);

    }

    NOTE - in debug-mode with SWD connected the device start normally at any freq. and also with HSE 24MHz

    Thanks in advance

    Paolo

    Tesla DeLorean
    Guru
    November 22, 2012
    Posted on November 22, 2012 at 15:24

    Is this demonstrable on an STM32L-Discovery board, or is this something else?

    Are you using the CMSIS library, which is presumably calling System_Init() prior to calling main()?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    paolo239955_stm1_stmicro_com
    Associate
    November 22, 2012
    Posted on November 22, 2012 at 16:05

    1 - No, the problem appear on a little and very simple board developed by us: uC in BGA package (STM32L151R6H6TR) with USB connection and EEPROM (I can send you the schematic or the layout...)

    2 - Yes:

    LDR     R0, =SystemInit

    BLX     R0              

    LDR     R0, =__main

    BX      R0