cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE debugger vs Atollic, how to make a startup script?

Pavel A.
Evangelist III

Apologize if this was already asked, I cannot find answers here.

In the Atollic debugger config there's a Startup script tab.

Default script looks like this:

# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# Uncomment next line, 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# Uncomment next line, 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
#monitor flash set_parallelism_mode 2
 
# Set character encoding
set host-charset CP1252
set target-charset CP1252
 
# Reset to known state
monitor reset
 
# Load the program executable
load		
 
# Reset the chip to get to a known state. Remove "monitor reset" command 
#  if the code is not located at default address and does not run by reset. 
monitor reset
 
# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
 
# Set a breakpoint at main().
tbreak main
 
# Run to the breakpoint.
continue

CubeIDE for ST-LINK server has two areas: Initialization commands and Run commands, both empty.

Questions:

  • What commands CubeIDE debugger issues by default when both areas are empty?
  • Where can we find reference of available commands?
  • If the server commands are same as for Atollic, where to break the Atollic script to "initialization" and "run" sections?

Actually I want to replace the "load" command to some action of my own bootloader which activates after the 1st reset (line 12), and avoid the 2nd reset after the "load" (as suggested by comment in line 18)

I'm looking for a way to load stuff into external volatile RAM without a custom external loader.

Any ideas?

-- pa

2 REPLIES 2
Markus GIRDLAND
ST Employee

Hello there!

There isn't really any command being issued except by the tick-boxes in that menu (for example "Set breakpoint at: main" replaces tbreak main)".

You can find more information about the Startup tab in chapter 3.2.4 of the User Guide which you can find here. Reference to available commands is any GDB or GDB server monitor commands. You can find these in the GDB documentation in the Documentation section in the Information Center of STM32CubeIDE. There's a "Quick Reference Card" that could probably be helpful.

Also, some commands are listed in the ST-LINK GDB Server Manual which can be found here.

The startup tab is in "chronological order", meaning the way you read from top to bottom is the way it will be processed which might help you define where "initialization" and "run" sections would be.

Let me know if anything is unclear.

Hi @Markus GIRDLAND​ , thank you for the reply.

So what event (or whatever) separates Initialization and Run sections? Is there an implicit "load" in the middle?

Should we prefer OpenOCD over the ST-Link server?

--pa