2014-12-01 07:34 AM
Hi everyone,
I'm trying to connect STMl152 at Debug mode (JTAG) but with no success. If i tracing the startup it stuck in SetSysClock (''system_stml1xx.c'') function on : /* Wait till PLL is used as system clock source */ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)RCC_CFGR_SWS_PLL) { } In the command window : ''Cannot access Memory''. Please advise,2014-12-01 07:37 AM
What are the chances your PLL or Flash Wait State settings are wrong?
Look at the code prior to this, you're looking at the symptom, not the cause.2014-12-01 08:04 AM
Thanks for the replay Clive.
Where exactly can I look ?? ...All the prior code to that are the original library startup files.2014-12-01 08:12 AM
Hi,
Try to connect using the ST-Link Utility, erase chip and the re-connect after loading your code again.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2014-12-01 08:17 AM
Hi Mayla,
Why should I move to ST-Link Utility, I'm using Keil connect through ULINK2 , it should work , No??2014-12-01 08:43 AM
Where exactly can I look ?? ...All the prior code to that are the original library startup files.
Well you're going to have to consider all the code from the reset vector to the point it jams up. Starting with the code nearest to the observed failure, and moving backward. And consider how your design (external crystals, etc) impact the settings used for the clocks, PLL, etc. If these are different you need to evaluate how these need to differ from the default setting.2014-12-04 02:00 AM
Unfortunately
I couldn't find any issue regarding FLASH time or PLL. So I took from STM32L1xx_StdPeriph_Template the MDK-ARM example , built on it the project and it works fine. Thanks.2014-12-09 02:04 AM
I have to open this issue again,
As i told before when i use STM32L1xx_StdPeriph_Template the MDK-ARM example it work. Now .... using same hardware and same project folders (MDK-ARM), but arrange differntly the folders it doesn't work --> again stuck before entering the Main (with memory access issue). Offcourse all files are compiled again. Now it doesn't seemed like clk/Flash wrong configuration (because I'm using same files that works). Please advise.2014-12-09 04:34 AM
If the failure is occurring at the project level, then you'll need to ponder the defines passed to the compiler, and the include file search paths.