Tools/EclipseArmebs4/SetupLinux/2015-10-27

From UIT
(Difference between revisions)
Jump to: navigation, search
(Linux)
(Trace viewer)
 
(11 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
This HOWTO has been tested on:
 
This HOWTO has been tested on:
 
  * ubuntu 15.10 64 bits
 
  * ubuntu 15.10 64 bits
 +
* lubuntu 16.04 64 bits
  
 
Using :
 
Using :
Line 36: Line 37:
 
   * GNU debugger
 
   * GNU debugger
 
  * openocd
 
  * openocd
   * Tranlate GDB orders into JTAG commands
+
   * Translate GDB orders into JTAG commands
  
 
Source files
 
Source files
Line 50: Line 51:
 
There is a PPA for gcc-arm-embedded.
 
There is a PPA for gcc-arm-embedded.
 
<source lang='bash'>
 
<source lang='bash'>
sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
+
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
 
sudo apt-get update
 
sudo apt-get update
sudo apt-get install build-essential gcc-arm-none-eabi arm-none-eabi-gdb
+
sudo apt-get install build-essential gcc-arm-embedded
 
</source>
 
</source>
  
= openocd =
+
 
== Linux ==
+
 
* install openocd (should be in the repository of your favorite distribution)
 
* install openocd (should be in the repository of your favorite distribution)
 
* create the file /etc/udev/rules.d/10-jtag.rules whith the following content:
 
* create the file /etc/udev/rules.d/10-jtag.rules whith the following content:
Line 100: Line 100:
 
# Constants
 
# Constants
 
ID="08ee 3100 ff"
 
ID="08ee 3100 ff"
SYS_FILE=/sys/bus/usb-serial/drivers/ftdi_sio/new_id  
+
SYS_FILE=/sys/bus/usb-serial/drivers/ftdi_sio/new_id
  
 
# modrpobe can be called with already loaded driver
 
# modrpobe can be called with already loaded driver
Line 114: Line 114:
 
** <code>sudo chmod +x /etc/udev/armebs4-serial.sh</code>
 
** <code>sudo chmod +x /etc/udev/armebs4-serial.sh</code>
 
* make sure you're in the <code>plugdev</code> and <code>dialout</code> groups, you must re-login if you change groups.
 
* make sure you're in the <code>plugdev</code> and <code>dialout</code> groups, you must re-login if you change groups.
** verify: <code>groups</code>
+
** verify: <code>groups <username></code>
* restart udev : <code>sudo service udev restart</code>  
+
** add: <code>sudo usermod -a -G dialout <username></code>
 +
* reload udev rules: <code>sudo service udev reload</code>  
 
* re-plug the ARMEBS4 board
 
* re-plug the ARMEBS4 board
  
 
= Eclipse =
 
= Eclipse =
Tested with eclipse 4.3 (Kepler) and 4.4 (Luna), but at least works with Juno (4.2) and Indigo (4.1)
+
Tested with eclipse 4.3 (Kepler), 4.4 (Luna) and 4.6 (Neon), but at least works with Juno (4.2) and Indigo (4.1)
 
* Help -> Install new software ... -> add site/repository: http://gnuarmeclipse.sourceforge.net/updates
 
* Help -> Install new software ... -> add site/repository: http://gnuarmeclipse.sourceforge.net/updates
* Help -> Install new software ... -> work with "-- All available sites --" and add at least : <br/>(Some of the items below might already be installed, e.g. if you installed Eclipse for C/C++. To make them appear in the list uncheck <code>Hide items that are already installed</code>.
+
* Help -> Install new software ... -> work with "-- All available sites --" and add at least :
 
*; Collaboration  
 
*; Collaboration  
 
*: Subversive SVN Team provider + subversive connector
 
*: Subversive SVN Team provider + subversive connector
Line 133: Line 134:
 
* After setup and restart, subversive should ask to choose a connector, choose:
 
* After setup and restart, subversive should ask to choose a connector, choose:
 
** SVNkit (same version as the subversion installed on your system)
 
** SVNkit (same version as the subversion installed on your system)
 +
 +
= Trace viewer =
 +
* Download : http://percepio.com/downloads/freertos-trace-tgz (tested with 3.0.6)
 +
* sudo apt install mono-complete
 +
* yes yes | mozroots --import
 +
* mono TzForFreeRTOS.exe
 +
 +
= Where to go from here ? =
 +
[[EclipseArmebs4/FirstSteps | First steps]]

Latest revision as of 10:10, 26 August 2016

Contents

Goal

Install a click-and-run IDE for stm32f4 based boards.

This HOWTO has been tested on:

* ubuntu 15.10 64 bits
* lubuntu 16.04 64 bits

Using :

* HEIVs armebs4 (stm32_camera board).
* ST's stm32f4discovery board.

Feel free to contribute (by editing or by email).

The big picture

Here is an overview of the tools :

Eclipse stm32.png

Detailed description

Hardware:

* JTAG adapter
  * Connects physically the host computer to the target, usually from USB to JTAG.
  * Can be integrated into the target
* Target board
  * HEIVs ARMEBS4 integrates a "jtagusb" JTAG adapter
  * ST stm32f4discovery integrates a st-link v2 JTAG adapter

Software:

* Eclipse + CDT
  * IDE with c/c++ support
* make
  * The classical program builder
* gcc, ld, as, ...
  * GNU compiler, linker, assembler, ...
* gdb
  * GNU debugger
* openocd
  * Translate GDB orders into JTAG commands

Source files

* Application source file
  * Your application
* libheivs_stm32
  * Collection of source files from various vendors (ST, ARM, ..., HEIVs) to be used on stm32 boards

Toolchain

The toolchain we use comes from https://launchpad.net/gcc-arm-embedded. This is a toolchain maintained by ARM employees and is available for Linux, Windows and OS X.

Linux (Ubuntu based)

There is a PPA for gcc-arm-embedded.

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install build-essential gcc-arm-embedded


  • install openocd (should be in the repository of your favorite distribution)
  • create the file /etc/udev/rules.d/10-jtag.rules whith the following content:
#
# \file /etc/udev/rules.d/10-jtag.rules
# \brief udev rules for drivers and ownership for ARMEBS4-like boards
# \author marc dot pignat at hevs dot ch
# \rev 1.0
#
# The ownership will be set to the 'plugdev' group
#
 
#
# AMREBS4-like (FTDI) integrated debugger and serial port
#
ATTRS{idProduct}=="3100", ATTRS{idVendor}=="08ee", MODE="666", GROUP="plugdev", RUN="/etc/udev/armebs4-serial.sh"
 
#
# STM32F4 discovery board (stlink-v2 and DFU)
#
ATTRS{idProduct}=="3748", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"
ATTRS{idProduct}=="df11", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"
 
#
# Amontec JTAGkey 2
#
ATTRS{idProduct}=="cff8", ATTRS{idVendor}=="0403", MODE="666", GROUP="plugdev"
  • create the file /etc/udev/armebs4-serial.sh whith the following content:
#!/bin/sh
#
# \file         /etc/udev/armebs4-serial.sh
# \brief        Load the ftdi sio (CDC) driver and add the ARMEBS4 VID+PID
# \author       marc dot pignat at hevs dot ch
# \rev          1.1
#
 
# Constants
ID="08ee 3100 ff"
SYS_FILE=/sys/bus/usb-serial/drivers/ftdi_sio/new_id
 
# modrpobe can be called with already loaded driver
modprobe ftdi_sio
 
# add our ID only if necessary
if ! grep -q "$ID" $SYS_FILE; then
        echo  $ID > $SYS_FILE
fi
  • make the file /etc/udev/armebs4-serial.sh executable
    • sudo chmod +x /etc/udev/armebs4-serial.sh
  • make sure you're in the plugdev and dialout groups, you must re-login if you change groups.
    • verify: groups <username>
    • add: sudo usermod -a -G dialout <username>
  • reload udev rules: sudo service udev reload
  • re-plug the ARMEBS4 board

Eclipse

Tested with eclipse 4.3 (Kepler), 4.4 (Luna) and 4.6 (Neon), but at least works with Juno (4.2) and Indigo (4.1)

  • Help -> Install new software ... -> add site/repository: http://gnuarmeclipse.sourceforge.net/updates
  • Help -> Install new software ... -> work with "-- All available sites --" and add at least :
    Collaboration
    Subversive SVN Team provider + subversive connector
    GNU ARM C/C++ Cross Development Tools
    GNU ARM OpenOCD Debugging
    Mobile and Device Development
    C/C++ GCC Cross Compiler Support
    C/C++ GDB Hardware Debugging
    Programming Languages
    C/C++ Development Tools
  • After setup and restart, subversive should ask to choose a connector, choose:
    • SVNkit (same version as the subversion installed on your system)

Trace viewer

Where to go from here ?

First steps

Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox