Skip to content

IDE and debug setup

Kurt Kiefer edited this page May 5, 2016 · 2 revisions

The PureThermal 1 firmware package includes project support for AC6 System Workbench for STM32, which includes a built-in ARM compiler and JTAG programmer/debugger running in the Eclipse IDE.

This wiki outlines how to set up this IDE, along with an ST-LINK/V2 in-circuit debugger/programmer. On Linux and Mac, this setup will also work with other OpenOCD-compatible programmers by a simple change to the PureThermal.cfg configuration file that is part of the firmware package.

Installation

These installation instructions are an abridged version from the official System Workbench for STM32 wiki. Please go there if you run into any problems or need more support.

  1. Install Eclipse IDE for C/C++ Developers

  2. Install ST-Link/V2 driver

    For Windows:

    1. Download the installer from one of the addresses below:
    2. Extract the installer from the downloaded zip file
    3. Install the driver by launching "stlink_winusb_install.bat" or launch the correct dpinst executable
    4. If you have connected the STLinkV2 device before installing the driver you must reload the driver:
    5. Open the device manager
    6. Right click on the flagged "STM32 STlink" device then Update driver...

    For Linux:

    1. Download the tarball containing udev rules: http://www.openstm32.org/dl160

    2. Extract the tarball into /etc/udev/rules.d under root permission:

sudo tar -xf stlink_udev_rule.tar.bz2 -C /etc/udev/rules.d ```

For Mac:

1. Plug STLink into USB port
  1. Install AC6 System Workbench for STM32 in Eclipse

    1. Start Eclipse then open menu "Help -> Install New Software"; this will open the "Available Software" dialog:

    2. You must then create a new update site, to be able to install System Workbench for STM32 - Bare Metal Edition:

      1. You should click on "Add:"
      2. Then give a name to the update site (System Workbench for STM32 - Bare Machine edition) and set the location to http://www.openstm32.org/Eclipse-updates/org.openstm32.system-workbench.site
      3. Then click "OK" to create the update site
    3. Then you should select all of the OpenSTM32 tools and click "Next>"

    4. You will then just have to accept the license and System Workbench for STM32 - Bare Metal edition will install itself in your Eclipse setup.

    Note that you will probably have to restart Eclipse for the tools to be available; Eclipse will automatically suggest the restart.

Clone PT1 git repo

Clone and check out the PureThermal 1 firmware code if you have not done so already.

git clone https://github.com/groupgets/purethermal1-firmware

Importing Project

  1. From C/C++ perspective in Eclipse, open File -> Import...
  2. Select General > Existing Projects into Workspace, and press Next
  3. Select Browse, and navigate to the directory where you have cloned the purethermal1-firmware repository
  4. Select the project 'devboard' and press Finish

You should now have the PureThermal 1 project in your Eclipse workspace (it is called 'devboard')

Building the Source code

You can Right-click the project and select "Clean Project" to clean the source code directory and "Build Project" to build the source.

Downloading code and debugging

  1. Connect the ST-Link/V2 to your computer
  2. Plug the 20-pin JTAG ribbon cable into the connector on the debugging breakout board
  3. Connect the flat-flex cable (FFC) between the zero insertion force (ZIF) sockets on the PureThermal 1 board and the debugging breakout board. Note to do this, you pull up on the black latch on the ZIF, insert the FFC on the opposite side (exposed metal contacts should face down), and push the black latch back down to lock in the FFC.
  4. Make sure the PureThermal 1 board has power and is turned on. Even if you plug it into your USB port to power, you must press the ON/OFF switch so that the target has power applied
  5. Build the source code if you have not done so already
  6. Be sure to select the 'devboard' project in the project explorer, then open the menu Run -> Debug, choose 'Ac6 STM32 C/C++ Application' and press OK.
  7. Code will be downloaded and execution will begin and then automatically halt before running MX_GPIO_Init();. You can now set additional breakpoints and press Resume (or F8) to continue execution.