OpenOCD must already be running if the gdb is to be started.
The following script can be used to start the gdb:
$Env:Path += ";D:\GNUArmEmbeddedToolchain\6-2017-q2-update\bin" cd C:\WorkingDir arm-none-eabi-gdb --command=gdbInit.txt
The “gdbInit.txt” contains commands that are processed one after the other when gdb is started. Of course, these can be adapted.
gdbInit.txt:
set extension-language .java minimal file M:/MA/stabs/loopWithSTABS dir M:/MA/stabs/ target remote localhost:3333 monitor reset halt #monitor halt load monitor reg pc 0
set extension-language.java minimal
configures the gdb to accept *.java source codefile
loads the compiled deep application as binary image or ELF filedir
defines the WorkingDir for the gdb. This is particularly relevant for source lookup.target remote localhost:3333
connects the gdb to OpenOCD'monitor reset halt
uses the OpenOCD command halt
to reset and stop the target'load
loads the machine code directly to the targetmonitor reg pc 0
sets the program counter to 0