-
Notifications
You must be signed in to change notification settings - Fork 64
IDE and debug setup
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.
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.
-
Install Eclipse IDE for C/C++ Developers
-
Install ST-Link/V2 driver
For Windows:
- Download the installer from one of the addresses below:
- For Windows 8, 7 or Vista : http://www.st.com/web/catalog/tools/FM147/SC1887/PF260218
- For Windows XP : http://www.st.com/web/catalog/tools/FM147/SC1887/PF260219
- Extract the installer from the downloaded zip file
- Install the driver by launching "stlink_winusb_install.bat" or launch the correct dpinst executable
- If you have connected the STLinkV2 device before installing the driver you must reload the driver:
- Open the device manager
- Right click on the flagged "STM32 STlink" device then Update driver...
For Linux:
-
Download the tarball containing udev rules: http://www.openstm32.org/dl160
-
Extract the tarball into /etc/udev/rules.d under root permission:
- Download the installer from one of the addresses below:
sudo tar -xf stlink_udev_rule.tar.bz2 -C /etc/udev/rules.d ```
For Mac:
1. Plug STLink into USB port
-
Install AC6 System Workbench for STM32 in Eclipse
-
Start Eclipse then open menu "Help -> Install New Software"; this will open the "Available Software" dialog:
-
You must then create a new update site, to be able to install System Workbench for STM32 - Bare Metal Edition:
- You should click on "Add:"
- 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
- Then click "OK" to create the update site
-
Then you should select all of the OpenSTM32 tools and click "Next>"
-
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 and check out the PureThermal 1 firmware code if you have not done so already.
git clone https://github.com/groupgets/purethermal1-firmware
- From C/C++ perspective in Eclipse, open File -> Import...
- Select General > Existing Projects into Workspace, and press Next
- Select Browse, and navigate to the directory where you have cloned the purethermal1-firmware repository
- Select the project 'devboard' and press Finish
You should now have the PureThermal 1 project in your Eclipse workspace (it is called 'devboard')
You can Right-click the project and select "Clean Project" to clean the source code directory and "Build Project" to build the source.
- Connect the ST-Link/V2 to your computer
- Plug the 20-pin JTAG ribbon cable into the connector on the debugging breakout board
- 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.
- 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
- Build the source code if you have not done so already
- 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.
- 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.