2023-12-24 11:44 PM
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
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.
Solved! Go to Solution.
2023-12-28 06:58 AM - edited 2023-12-28 06:59 AM
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.
2023-12-26 09:34 AM
Step into HAL_Init and see where specifically it is failing. Likely that will tell you the issue.
2023-12-27 06:43 AM
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.
2023-12-27 10:58 PM - edited 2023-12-27 11:00 PM
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 ;
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;
i think it is about JTMS-SWDIO function up there in the PA13. And the exact line i get the error is this ;
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.
2023-12-28 01:06 AM
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 :
So you have a basically working cpu with debug (and swo here) and NOW set other functions as you like... :)
2023-12-28 06:58 AM - edited 2023-12-28 06:59 AM
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.