2017-03-26 12:35 PM
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.
#hal-v1.7.0 #eclipse-debug #systick #stm32f0 Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-03-26 05:18 PM
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();}2017-03-27 02:57 AM
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
:(
.2017-03-27 08:21 AM
>>
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?
2017-03-27 01:26 PM
The file is treated as C/C++.
In fact the handler is not called.
I put a breakpoint and it never gets there.
If I do not debug, the code runs and the LED flashes.
I will try change some project properties.
2017-03-27 02:14 PM
Very odd, not familiar with the tool chain you are using.
For .cpp or C++ make sure interrupts are of the form extern 'C' void SysTick_Handler(void)
2017-03-27 02:39 PM
Bahh..
I' getting this again.
2017-03-27 05:28 PM
I'm definitely not getting any breakthrough.
I created a new, simple project, to just blink an LED.
I can use ST-Link to program without problems ... but I can not debug.
Here is the project.
https://meocloud.pt/link/598784ec-fa1d-42d8-af76-7cb16e4d0636/debug.rar/
What am I doing wrong?
At work I'm using a setup very similar to this, but with an STM32F302.
The debug runs smoothly.
2017-03-27 06:45 PM
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; // Are we sure x12 is reasonable, try x6
2017-03-30 01:21 AM
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.