Aleksandr
Aleksandr

Reputation: 21

GDB and OpenOCD - reset or resume after end of debugging

I am using Eclipse + GDB Hardware Debugging + OpenOCD + STM32F4DISCOVERY (over ST-LINK)

All work OK.

After completion of the debugging, target CPU is still in the Halt mode. How to make so that after the debug (Terminate pressed) target CPU reset or continued to work?

Upvotes: 2

Views: 3748

Answers (2)

Hugo Elbzh
Hugo Elbzh

Reputation: 21

I configure openocd to resume execution when gdb session ends.

Create openocd-gdb.cfg containing :

$_TARGETNAME configure -event gdb-detach {
    resume
}

Load the file, after the target file, when running openocd :

openocd -f target/stm32f4.cfg -f openocd-gdb.cfg

Upvotes: 2

Lui
Lui

Reputation: 159

I'm doing this in this way:

  1. Writing a bash-script which connects via Telenet to OpenOCD and excecutes the run or reset command.
    1. Run the script via the external-tools-feature of eclipse
    2. May create a Launchgroup which runs the script as external tool after debugging.

Here is a script-example:

#!/bin/bash
{ 
    echo "reset halt";
    echo "reset run";
} | telnet localhost 4444

Upvotes: 1

Related Questions