Getting started build and debug - xtopher88/STM32Basic GitHub Wiki

Windows 7 64bit

Starting GDB server

  1. Connect the ST-link or the discovery board and ensure that the USB driver is found
  2. In a terminal(cmd) window go to the bin-x64 directory where the openOCD is located
  3. Start openocd > openocd-x64-0.7.0-rc2.exe -f stm32f4discovery.cfg
  4. There should not be any errors, this is setting up a GDB server on localhost port 3333 so it will need network access. If you see "Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints" then the connection is probably working

Eclipse Setup

  1. Install gdb hardware debugging
  • Help->Install New Software
  • In the "Work with:" entry box click on the down arrow and select the eclipse release that you are using ( Juno - http://download.eclipse.org/releases/juno )
  • Under "Mobile and Device Development" select "C/C++ GDB Hardware Debugging" and install.

Creating eclipse project and building

  1. A new makefile project from existing code
  • File->New->Makefile project with existing code
  • Select the directory of the project

Setting up debug configuration

Debugging project