Skip to main content
eng239955
Associate
November 17, 2015
Question

SWD debugging problem

  • November 17, 2015
  • 5 replies
  • 1417 views
Posted on November 17, 2015 at 12:34

i made my stm32f030k6t6 board and i connect it to stlink 

after that  i generate keil V5 project using stmcube .

i  enabled the SWD pins only , after that i compiled the program and download it ,i start the debugger ,but when the program execute the [HAL_RCC_OscConfig()] the debugger send message that it cant communicate with core and every thing stop working ??

0690X00000605JqQAI.png

 

#swd #stm32
This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
November 17, 2015
Posted on November 17, 2015 at 13:41

Maybe you can provide the generated code where it crashes, and information about the external clocks on your board?

You'll want to look to see if there is anything that would alter the SWD pins, or put the device into a low power mode.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Amel NASRI
Technical Moderator
November 17, 2015
Posted on November 17, 2015 at 14:50

Hi mohammed_sayed,

With CubeMX generated code, pins are set to there default status if not configured with the tool.

To be able to debug the STM32F1 device in SWD mode, you have to select ''Serial-Wire'' in SYS configuration (Pinout wizard).

-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.
Tesla DeLorean
Guru
November 17, 2015
Posted on November 17, 2015 at 15:19

To be able to debug the STM32F1 device in SWD mode,...

 

He states he has an F0 device

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
stm322399
Senior
November 17, 2015
Posted on November 17, 2015 at 15:54

I guess that your custom board has a different clock scheme (no quartz ?), so the software running on the eval board has no chance to run until customized as well.

eng239955
eng239955Author
Associate
November 17, 2015
Posted on November 17, 2015 at 18:27

thank you for replay 

first i use [HSI] with default trim ,

then i passed it to PLL with (x12) PLLmul  to achieve 48MHZ (max clock speed )   

i traced the code and i found that the stlink lose connection with target gust after enable pll using  [__HAL_RCC_PLL_ENABLE();]

if i reduce the PLLmul less than (x6) it run fine

i also test Ulink 2 and the same result  

@Mayla 

i did what you mention  in stmcube 

0690X00000605JrQAI.png