cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L151 unable to enter Main() on debugging with STLINKV2

dannypkchan
Associate II
Posted on January 02, 2015 at 06:46

Hi, just soldered my STM32L151CB 48Pins with below configuration :

1. SWD, both SWDIO, SWCLK (no pull up or down), VDD, GND connected to STLINKV2

2. Boot 0 (NC) 

3. OSC32 I O, OSC I O (NC), i used to use internal oscillator as STM32F103 

4. WKUP2 and WKUP1 (NC) 

i am new to low power like this, my problem is on connected with STLINKV2, the mcu can be detected, but when debug it, it never entered to main() 

thanks 

3 REPLIES 3
Posted on January 02, 2015 at 14:54

Debug how and with what? If you break execution where is the code?

You might want to pull BOOT0 low to ensure it executes your code. You should also be able to uncheck options like ''Run to main()'' and step through the code that runs prior to it getting to main(). This will include the SystemInit() code in system_stm32l1xx.c to set up the clocks and PLLs, and flash wait states. Make sure these are appropriate to your other design choices.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dannypkchan
Associate II
Posted on January 07, 2015 at 06:50

yes we did unchecked options ''Run to main()'', but it still even not enter SystemInit(), we have error in command window ''Can not access memory'' 

do you think this might caused problem ?  

dannypkchan
Associate II
Posted on January 07, 2015 at 08:48

thanks, by pull down boot0 to low, it work ok, my point is on stm32f1xx to f3xx i don't need to care about boot0 pin just leave it floating.