Tools/Eclipse4STM32

(Difference between revisions)
Jump to: navigation, search
(Windows)
Line 13: Line 13:
 
== Linux (generic) ==
 
== Linux (generic) ==
 
* Download [https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2]
 
* Download [https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2]
* Uncompress into /opt (arm-none-eabi-ld should be in /old/opt/xdev/gcc-arm-none-eabi-4_7-2013q1/bin/)
+
* Uncompress into /opt (arm-none-eabi-ld should be in /opt/xdev/gcc-arm-none-eabi-4_7-2013q1/bin/)
  
 
== Windows ==
 
== Windows ==
Line 40: Line 40:
 
* Unzip into c:\xdev\tools\openocd\0.7 (openocd-0.7.0.exe should be in C:\xdev\tools\openocd\0.7.0\bin)
 
* Unzip into c:\xdev\tools\openocd\0.7 (openocd-0.7.0.exe should be in C:\xdev\tools\openocd\0.7.0\bin)
 
* rename openocd-0.7.0.exe into openocd.exe
 
* rename openocd-0.7.0.exe into openocd.exe
* Download and install this driver [[File:libusb-win32_stlink_driver-120229.zip]]
+
* For the stm32f4 discovery board (st-link) : Download and install this driver [[File:libusb-win32_stlink_driver-120229.zip]]
 +
* For the other boards FIXME
  
 
= Eclipse =
 
= Eclipse =
Line 47: Line 48:
 
   * Programming Languages : C/C++ development Tools
 
   * Programming Languages : C/C++ development Tools
 
   * Mobile and Device Development : C/C++ Hardware Debugging
 
   * Mobile and Device Development : C/C++ Hardware Debugging
 +
  * Mobile and Device Development : C/C++ Cross compiler support
 
   * Subversive SVN Team provider + subversive connector
 
   * Subversive SVN Team provider + subversive connector
 
* 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 1.7.9
 
   * SVNkit 1.7.9
 +
 +
= Project Setup =
 +
In the project properties make sure
 +
* C/C++ build > settings -> Settings tab : "Cross settings" :
 +
    * prefix : "arm-none-eabi-"
 +
    * path (windows) : "C:\xdev\tools\gcc-arm\4.7_2013q2\bin"
 +
    * path (Linux generic) : "/opt/xdev/gcc-arm-none-eabi-4_7-2013q1/bin/"
 +
    * path (Unbutu based) : arm-none-eabi- tools are in the PATH.
 +
* C/C++ build > settings -> Settings tab : "Cross GCC compiler" :
 +
  * Symbols :
 +
    * STM32F4XX=1
 +
    * ARM_MATH_CM4=1
 +
    * __FPU_PRESENT=1
 +
    * USE_STM324xG_EVAL=1
 +
  * Includes :
 +
    * "${workspace_loc:/${ProjName}/libheivs_stm32/include}"
 +
    * "${workspace_loc:/${ProjName}}"
 +
  * Debugging:
 +
    * Maximum -g3
 +
  * Warnings:
 +
    * -Wall
 +
  * Miscellaneous
 +
    * "-c -fmessage-length=0 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
 +
* C/C++ build > settings -> Settings tab : "Cross GCC linker" :
 +
  * General :
 +
    * No shared libraries (-static)
 +
  * Libraries
 +
    * m
 +
  * Miscellaneous
 +
    * Linker flags : "-T "${workspace_loc:/${ProjName}/libheivs_stm32/stm32f407ig_flash.ld}" -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
 +
    * Other options (-Xlinker [option])
 +
      * -Map=linker.map
 +
      * --gc-sections
 +
* C/C++ build > settings -> Settings tab : "Cross GCC assembler" :
 +
  * General:
 +
    * Assembler flags : "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g3"

Revision as of 12:07, 15 July 2013

Contents

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:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install build-essential gcc-arm-none-eabi

Linux (generic)

Windows

openocd

Linux

  • 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:
# STM32f407 discovery (stlink and DFU mode)
ATTRS{idProduct}=="cff8", ATTRS{idVendor}=="0403", MODE="666", GROUP="plugdev"
ATTRS{idProduct}=="3748", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"
 
# Amontec JTAGkey 2 
ATTRS{idProduct}=="df11", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"
  • make sure you're in the plugdev group

Windows

  • Download and install openocd-0.7.0
  • Unzip into c:\xdev\tools\openocd\0.7 (openocd-0.7.0.exe should be in C:\xdev\tools\openocd\0.7.0\bin)
  • rename openocd-0.7.0.exe into openocd.exe
  • For the stm32f4 discovery board (st-link) : Download and install this driver File:Libusb-win32 stlink driver-120229.zip
  • For the other boards FIXME

Eclipse

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

  • Help -> Install new software ... -> work with "-- All available sites --" and add at least :
 * Programming Languages : C/C++ development Tools
 * Mobile and Device Development : C/C++ Hardware Debugging
 * Mobile and Device Development : C/C++ Cross compiler support
 * Subversive SVN Team provider + subversive connector
  • After setup and restart, subversive should ask to choose a connector, choose:
 * SVNkit 1.7.9

Project Setup

In the project properties make sure

* C/C++ build > settings -> Settings tab : "Cross settings" :
    * prefix : "arm-none-eabi-"
    * path (windows) : "C:\xdev\tools\gcc-arm\4.7_2013q2\bin"
    * path (Linux generic) : "/opt/xdev/gcc-arm-none-eabi-4_7-2013q1/bin/"
    * path (Unbutu based) : arm-none-eabi- tools are in the PATH.
* C/C++ build > settings -> Settings tab : "Cross GCC compiler" :
  * Symbols :
    * STM32F4XX=1
    * ARM_MATH_CM4=1
    * __FPU_PRESENT=1
    * USE_STM324xG_EVAL=1
  * Includes :
    * "${workspace_loc:/${ProjName}/libheivs_stm32/include}"
    * "${workspace_loc:/${ProjName}}"
  * Debugging: 
    * Maximum -g3
  * Warnings:
    * -Wall
  * Miscellaneous
    * "-c -fmessage-length=0 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
* C/C++ build > settings -> Settings tab : "Cross GCC linker" :
  * General :
    * No shared libraries (-static)
  * Libraries
    * m
  * Miscellaneous
    * Linker flags : "-T "${workspace_loc:/${ProjName}/libheivs_stm32/stm32f407ig_flash.ld}" -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16"
    * Other options (-Xlinker [option])
      * -Map=linker.map
      * --gc-sections
* C/C++ build > settings -> Settings tab : "Cross GCC assembler" :
  * General:
    * Assembler flags : "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g3"
Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox