cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE: How to enter commands in the debug configuration as in TrueStudio?

MB_Inv
Associate III

Hello,

I used the following "Target Software Startup Script" in the debug configuration in Atollic TrueStudio (this is necessary since we're using a bootloader and our application binary which I would like to debug is not placed at the beginning of the STM32 flash):

0690X000008iJtzQAE.jpg

How to enter this in STM32CubeIDE?

I would really need to debug my firmware, but can't figure out how to do the required settings...

Any ideas?

Kind regards,

Markus

33 REPLIES 33
MB_Inv
Associate III

My last tests with SEGGER J-Link didn't include the speed settings.

I also tried with the same three initialization commands (yes, I had initially picked the wrong addresses which came from some old debug config setup that I had)

---

set *0xe000ed08 = 0x08020000

set $sp = *(unsigned int*)0x08020000

set $pc = *(unsigned int*)0x08020004

---

Yes, I selected ST-Link as debug probe:

0690X000008iT7ZQAU.jpg

Legacy member
Not applicable

Try creating a new project and copy over your sources. See if that helps.

MB_Inv
Associate III

Just tried to create a new project in CubeIDE, copied over the sources and adapted the build settings and the linker script. But still, debugging works with J-Link, but not with ST-Link. After downloading the binary, the latter can't read out the target...

Legacy member
Not applicable

Do you have any projects in CubeIDE other than the one you are currently working on that works with ST-Link?

If you have, you could compare and see what is the difference?

If you don't, maybe create a very simple CubeIDE project for your hardware and see if you can program it using ST-Link?

Legacy member
Not applicable

I am assuming your ST-Link works with Atollic?

MB_Inv
Associate III

Yes, the ST-Link works with Atollic TrueStudio 9.2.0 - just rechecked it.

Will also try with another project in CubeIDE.

MB_Inv
Associate III

Have now also tried with an STM32F4DISCOVERY board and example project using CubeIDE and debugging works without any problems using ST-Link (onboard of the eval board).

But I can't figure out what the difference is here (except from the fact that my own program is located at another flash position and thus needs the additional initialization commands)...

Using the following initialziation commands, the execution of the command is always trapped in the Default_Reset_Handler:

---

set host-charset CP1252

set target-charset CP1252

set *0xE000ED08 = 0x08020000

set $sp = *(unsigned int*)0x08020000

set $pc = *(unsigned int*)0x08020004

tbreak main

continue

---

So I thought that maybe there's some problem with my linker file, but in Atollic TrueStudio it worked without problems - likewise with the J-Link in CubeIDE...

Any ideas?

Legacy member
Not applicable

I wonder if it is a project settings issue...

If you make a copy of the example project that works, and replace the source code with the one that is having issues, does it work?

MB_Inv
Associate III

I just tried that. I copied my sources and linker script to the working project and set the corresponding includes. However, the effect is the same - Debugging with J-Link works, but using the ST-Link execution hangs in the Default_Reset_Handler...

Legacy member
Not applicable

Maybe try testing with just your bootloader. Are you able to debug your bootloader with ST-Link?