2012-11-14 02:40 AM
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
#clive12012-11-14 08:04 AM
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.2012-11-17 05:19 AM
2012-11-22 02:49 AM
I have a similar problem with STM32L152xx
Configuration:Clock source: MSIfreq.: 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 24MHzThanks in advancePaolo2012-11-22 06:24 AM
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()?2012-11-22 07:05 AM
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, =SystemInitBLX R0 LDR R0, =__mainBX R0