Manual ARM Microcontroller Course E.T.S.V. Scintilla

Manual ARM Microcontroller Course E.T.S.V. Scintilla

2 Setup Eclipse and Toolchain

In this course Eclipse is used as the IDE, as it’s cross-platform and highly customizable. It is recommended to use a clean install of Eclipse 4.4 Luna for

C/C++. Besides Eclipse you’ll need to install some Eclipse plugins and drivers for STLink, the device that connects to your Nucleo board. The guide is written with Windows and GNU/Linux in mind, but it should work as well on OSX.

2.1

Windows

This guide assumes that you’ve a recent version of Java Runtime Environment installed. If needed you can download JRE from http://www.oracle.com/ technetwork/java/javase/downloads/jre8-downloads-2133155.html

.

2.1.1

Eclipse

1. Go to http://www.eclipse.org/downloads/ and download Eclipse

IDE for C/C++ Developers

2. Unpack and install.

3. Go to Help → Install New Software

4. click on Add..., fill in Name: GNU ARM Eclipse Plug-ins.

Location: http://gnuarmeclipse.sourceforge.net/updates and press OK

5. select all but the Freescale Project Templates, click Next and install.

2.1.2

Toolchain

1. Get the toolchain from https://launchpad.net/gcc-arm-embedded .

(gcc-arm-none-eabi***-win32.exe)

1

2. Install the toolchain, but in the final window disable "Add path to the environment variable".

3. Download the latest build tools (gnuarmeclipse-build-tools-win32-2.*-*setup.exe) from http://sourceforge.net/projects/gnuarmeclipse/ files/BuildTools/

4. Run the installer, remember the path of the Build Tools.

5. In Eclipse, go to Window → Preferences. C/C++ → Build → Global

Tools Paths

6. Locate the installed Build tools, enter the path in Build Tools folder.

7. Select GNU Tools for ARM Embedded Processors, locate the toolchain and enter the path in Toolchain folder, and click Apply.

1

On 2/5/2015: https://launchpad.net/gcc-arm-embedded/

4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_

9-2015q1-20150306-win32.exe

5

2.1.3

STLink v2

1. Download the latest STLink v2 driver from http://www.st.com/web/ catalog/tools/FM147/SC1887/PF260218

2. Extract files and run stlink_winusb_install

3. Install driver.

4. Download STLink Utility from http://www.st.com/web/en/catalog/ tools/PF258168

, install.

2.1.4

Debugger - OpenOCD

This is optional, but a debugger might help you a lot. We’re using OpenOCD as it’s available for all platforms, and easily integrates with the Eclipse plugins we installed.

1. Download the latest development (0.9.*) version of OpenOCD for your architecture from http://sourceforge.net/projects/gnuarmeclipse/ files/OpenOCD/Windows/ .

2. Follow the installation procedure.

3. In Eclipse go to Window → Preferences → Run/Debug → String Substitutions

4. Fill in the path to the bin directory of OpenOCD in the Value field of openocd_path, then click OK.

5. How to configure the debugger is explained in section

3.3

.

2.1.5

Packs - Device Support

1. In Eclipse, open the Packs perspective.

2. Click on the Refresh button. It will now load all available packs from Keil.

3. Select the device menu, locate the STM32F4 series and install the package.

2.2

Linux

This guide assumes a working Java runtime environment. It was tested using

OpenJDK 1.8, and should work equally well with a recent version of Oracle

JRE.

2.2.1

Toolchain and Eclipse

1. Get the toolchain from https://launchpad.net/gcc-arm-embedded

(gcc-arm-none-eabi***-linux.tar.bz2)

2. Extract to a directory of your liking.

3. Install Eclipse Luna for C/C++ development, if you haven’t already.

2

2

Either via your package manager, or by downloading from http://www.eclipse.org/ downloads/

6

4. open Eclipse, set a workspace and click on Help → Install New software.

5. click on Add..., fill in Name: GNU ARM Eclipse Plug-ins.

Location: http://gnuarmeclipse.sourceforge.net/updates and press OK

6. select all but the Freescale Project Templates, click Next and install.

7. In Eclipse, go to Window → Preferences. C/C++ → Build → Global

Tools Paths

8. Select GNU Tools for ARM Embedded Processors, locate the toolchain and enter the path in Toolchain folder.

2.2.2

STLink flasher for Linux

The STLink Utility provided by STMicroelectronics is Windows only, but an open source alternative is available on GitHub.

1. Go to http://github.com/texane/stlink , download the Zip file

2. Extract the zip file to a preferred location.

3. In a terminal cd to the directory the files are in, and build stlink using:

./ autogen .

sh

./ configure make sudo make install

4. get the path of st-flash using: whereis st flash

5. In Eclipse, click Run → External Tools → External Tools Configurations

6. Click on Program, and then on New. Name the new configuration st-linkv2 flash, and paste the path to st-flash in the Location field.

Working directory: ${project_loc}/Release

Arguments: write ${project_name}.bin 0x8000000

7. Click Apply and close.

2.2.3

Debugger - OpenOCD

This is optional, but a debugger might help you a lot. We’re using OpenOCD as it’s available for all platforms, and easily integrates with the Eclipse plugins we installed.

1. Download the latest development (0.9.*) version of OpenOCD for your architecture from http://sourceforge.net/projects/gnuarmeclipse/ files/OpenOCD/GNULinux/

.

2. Extract the package to a directory.

3. In Eclipse go to Window → Preferences → Run/Debug → String Substitutions

7

4. Fill in the path to the bin directory of OpenOCD in the Value field of openocd_path, then click OK.

5. How to configure the debugger is explained in section

3.3

.

2.2.4

Packs - Device Support

1. In Eclipse, open the Packs perspective.

2. Click on the Refresh button. It will now load all available packs from Keil.

3. Select the device menu, locate the STM32F4 series and install the package.

8

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project