Skip to main content
David Martins
Senior
March 26, 2017
Question

Debug problems with STM32F030

  • March 26, 2017
  • 2 replies
  • 1566 views
Posted on March 26, 2017 at 21:35

Hello.

I'm trying to debug code on STM32F

SWD debug wire is enabled.

I can get into debug mode!

The problem is that the code blocks whenever a HAL_Delay() occurs.

I think the problem is related to systick timer, because the program counter does not move from here.

I do not know how to solve this problem.

Look at this picture.

https://spostimg.org/5hk0ey4b5/Capturar.jpg

The code is very simple, as you can see here.

https://s3.postimg.org/wsyj52ecj/Capturar.jpg

#hal-v1.7.0 #eclipse-debug #systick #stm32f0

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
March 27, 2017
Posted on March 27, 2017 at 02:18

Make sure that SysTick is enabled, you have a proper handler, and the vector table links correctly

In stm32f0xx_it.c

/**

* @brief This function handles SysTick Handler.

* @param None

* @retval None

*/

void SysTick_Handler(void)

{

HAL_IncTick();

}
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
David Martins
Senior
March 27, 2017
Posted on March 27, 2017 at 09:57

The MCU settings were made with CubeMX.

By default this handler should be enabled.

I went to check and everything is OK.

https://spostimg.org/kp3cpj0jr/Capturar.jpg

This situation is very strange.

Not using debug is not an option for me.

It was the only free connection I left on my PCB

:(

.

Tesla DeLorean
Guru
March 27, 2017
Posted on March 27, 2017 at 15:21

>>

This situation is very strange.

There are still only a handful of reasons why it is not working. CubeMX only saves you from knowing what's going on, and that's only helpful until it gets things wrong. If everything was OK, it would work. I doubt the debugger is stopping SysTick from working.

Is it treating the stm32f0xx_it.c file as a .cpp or C++ file? Does the handler get called, break-point it?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
zhivko zivkovic
Associate II
March 30, 2017
Posted on March 30, 2017 at 10:21

I use AC6 Eclipse eveloping environment with BlackMagic probe (that is hardware GDB server:

https://github.com/blacksphere/blackmagic/wiki

), and for me it seems that debugger is stoping freezing whole processor also interrupts calling SysTIck_Handler() - so I think this is completely normal operation and it is not possible that interrupts are called while you are in debug mode.

I was also asking same thing in ##stm32 irc forum, and guys confirmed that.

However if there is possibility the interrupts to run while debugger is holding uC at some line I would be very thankful if somebody explains how to do that (preferebly in AC6).

I am developing some motor PID project that runs on stm32f3 that I could use that feature very much.

https://github.com/zhivko/EclipseStm32

 

I have also used CubeMX to produce lower layer code.