cancel
Showing results for 
Search instead for 
Did you mean: 

What happened with my STM32

Dudenkov.Vladimir
Associate II
Posted on June 20, 2016 at 16:08

[Stm32F103] I can programm flash with ST-LINK utility, but program does not start. Also Keil can't run debug. Keil can programm flash, but stm does nothing. Internet search returned no results.

6 REPLIES 6
AvaTar
Lead
Posted on June 20, 2016 at 16:16

> I can programm flash with ST-LINK utility, but program does not start.

 

That is basically just an assumption.

Quite possibly, your program crashes quickly, before it can indicate any activity (like LED blinking of serial output). Perhaps it gets stuck in the clock initialization, or hardfaulting in peripheral initializations.

Some debugging would be in order - or you post some code, so some one can check it for obvious errors.

> Also Keil can't run debug.

 

Have you rededicated the JTAG/SWD pins ? That would surely exclude the debugger.

Dudenkov.Vladimir
Associate II
Posted on June 20, 2016 at 16:47

I write the easiest code:

GPIO_InitTypeDef GPIO_TEST;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

GPIO_TEST.GPIO_Pin = GPIO_Pin_4;

GPIO_TEST.GPIO_Mode = GPIO_Mode_Out_PP;

GPIO_TEST.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_Init(GPIOA, &GPIO_TEST);

while(true)

{

GPIO_SetBits(GPIOA, GPIO_Pin_4);

GPIO_ResetBits(GPIOA, GPIO_Pin_4);

}

Oscilloscope silent on this pin.

>Have you rededicated the JTAG/SWD pins ? That would surely exclude the debugger.

 

I use programmer from STM32L152 Discovery. Connection occurse via SW. Used SWCLK, GND, SWDIO, NRST. All pins connected correctly, because debug in Keil worked until now.

Posted on June 20, 2016 at 17:14

Uncheck ''run to main'' and debug from the Reset_Handler on in. Check what the code in SystemInit() is doing as this runs before your code in main(). Stop the code in the debugger to understand where it is stuck.

Makes sure it verifies what is downloaded, and you don't have the BOOTx pins set oddly. Trying doing a full erase of the device.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Dudenkov.Vladimir
Associate II
Posted on June 20, 2016 at 17:49

I can't get into the debug. Look at it.

http://i67.tinypic.com/dpwzkk.jpg

Posted on June 20, 2016 at 19:23

What did you change since it was last working properly?

Open a Memory view of 0x08000000 and confirm you have a valid vector table there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Dudenkov.Vladimir
Associate II
Posted on June 21, 2016 at 17:53

>What did you change since it was last working properly?

I tryed start debug session, but it worked uncorrectly (microcontroller is worked yet). Then I tryed erase and reprogramm flash. Then it stopped working as before.