cancel
Showing results for 
Search instead for 
Did you mean: 

Can't start Debugging on STM32CubeIDE

erincyldz
Associate III

I was working on my stm32f411re nucleo boards. i was using two of them with spi full duplex mode one as the master and the other one as the slave. I was working on my codes and at a certain point when i tried to debug one, it asked me to upgrade my st-link and i upgraded. then, all of a sudden i wasnt able to debug my stm. The occuring error is like;

I connect my STM -> I start Debug -> it builds, loads, verifies -> It stopts at HAL_Init() function as always -> when i start F8(continue) it gives the following error 

erincyldz_0-1703490146873.png

it gives exactly the same errors on both boards. I tried it on a different computer that was using a newer version of the IDE(I was using 1.13.1 and it was version 1.14.0) and on that computer it also asked to upgrade st-link. It upgraded again and started debugging normally. I upgraded my STM32CubeIDE to 1.14.0 but the result is the same. I need help once again guys.

1 ACCEPTED SOLUTION

Accepted Solutions

PA13 is used by the debugger. Initializing it as something else (GPIO input) breaks the debugger connection and gives you the error you see.

Thanks for posting the debugging process.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
TDK
Guru

Step into HAL_Init and see where specifically it is failing. Likely that will tell you the issue.

If you feel a post has answered your question, please click "Accept as Solution".
Rim LANDOLSI
ST Employee

Hello @erincyldz and welcome to the community,

 

As described in the HAL package, the function HAL_Init() is used to initialize the HAL library and must be the first instruction to be executed in the main program. Could you please debug your code again and step into the function ''HAL_Init'' to know where exactly it gets blocked?
Could you also provide the debug configuration for this project?

 

Thanks,

Rim.

erincyldz
Associate III

I am getting an error inside the function HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);. I am using 4 PA pins as external interrupt which are ;

erincyldz_0-1703746232129.png

and while the functions loops for initializing the pins one by one, it gives an error at PROBABLY pin PA13 and after seeing that i decided to check the datasheet for stm32f411re and saw this;

erincyldz_1-1703746371132.png

i think it is about JTMS-SWDIO function up there in the PA13. And the exact line i get the error is this ;

erincyldz_2-1703746644119.png

GPIOx -> MODER =temp;

 

soooo.. im waiting for your replies people. thanks 

 

 

*** QUICK UPDATE ***

I removed the pin PA13 from my project and it debugs perfectly well... So I want to know why it creates a problem and why the application does not gives a warning about this i want to know the reason.

There is no error, the cpu doing, what you "ordered" it to do: use pin PA13 as an EXTI , not for debug.

So after debug->flash->starting your program (and no more debug ) is exactly what you defined.

If you want debug, and a clock, that drives the cpu, and a systick, so HAL can work (with delays, it needs ),

define in Cube at first these important settings, then you cannot use pins for other things and spoil the function of the cpu.

When you set this first :

AScha3_0-1703754324231.png

So you have a basically working cpu with debug (and swo here) and NOW set other functions as you like... 🙂

If you feel a post has answered your question, please click "Accept as Solution".

PA13 is used by the debugger. Initializing it as something else (GPIO input) breaks the debugger connection and gives you the error you see.

Thanks for posting the debugging process.

If you feel a post has answered your question, please click "Accept as Solution".