

In fact – OpenOCD doesn’t even need to run on the same machine as your debugger, as long as it is accessible via network. OpenOCD also doesn’t have to be started via Eclipse – you may start it manually in the terminal emulator if you like. If your debugging session ends, you don’t have to quit or restart OpenOCD – it may continue running in the background as long as required. Whenever you want to start a debugging session, OpenOCD should be running in the background.

OpenOCD works as a GDB remote server, so it is basically a middleman between GDB debugger and the hardware. It is also worth noting that drivers for the debugging interface – so in case of our board this would be ST-LINK/V2 – have to be installed in your system (if not already present), otherwise the steps described further in this chapter will fail to work. In this paragraph we will be using a STM32F4DISCOVERY board, so for a different setup you’ll need to adjust some configurations accordingly. This is actually the most tricky part of the whole process, as the exact procedure is slightly different for every board or a combination of debugging interface with target chip. In Debug perspective Project Explorer is not visible at all, editor, Outline and panel with various tabs ( Console, Problems, …) are moved a bit lower, while the top part of the window is occupied by the Debug tab on the left (this is where the call stack will be displayed) and the right part is reserved for tabs like Variables, Breakpoints, Registers, Expressions and some others. The process of plugin installation will take a short while (the progress will be displayed in the status bar at the bottom of Eclipse’s window) and when it finishes, you’ll be asked to restart Eclipse – confirm with Restart Now and you are done with this step. In the final step – Review Licenses – you have to select I accept the terms of the license agreement (obviously after you’ve read it carefully, understood completely and consulted your lawyers – which is what we all do when presented with a wall of incomprehensible legal text ( ) and click Finish. In the next step – Install Details – just click Next again. After a short while you should see a couple of suggestions – select the checkbox next to C/C++ GDB Hardware Debugging in the CDT Optional Features group and click Next at the bottom of the window. Place your cursor in the filter text box – the one which has gray type filter text, just below Work with label – and enter gdb there. CDT - ) or something very similar, depending on the version of Eclipse.

In this window from the Work with drop-down select the most recent CDT update site – this will be an entry like CDT - (e.g.

Click on Help menu and select Install New Software… to open the window titled Install. Before we can proceed any further, you have to install C/C++ GDB Hardware Debugging plugin for Eclipse.
