Skip to content

STM32 : Eclipse Setup (Linux)

September 14, 2014

Arm Toolchain Setup

  1. Getting the toolchain
    1. https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major
  2. Install into /opt

openOCD Setup

  1. Download latest sources
    1. http://openocd.sourceforge.net/
  2. Build from source and install
    1. ./configure
    2. make
    3. sudo make install

Eclipse IDE Setup

  1. Install latest eclipse (using Juno for now)
  2. Launch Eclipse
    1. Help -> Install New Software
    2. Add ->
      1. Name: STM32
      2. Location: http://gnuarmeclipse.sourceforge.net/updates
    3. Install ‘GNU ARM C/C++ Cross Development Tools’

To be document

  1. configure arm-toolchain in eclipse
  2. configure openOCD in eclipse
  3. Once above is setup correctly (already done, pending documentation), chip flashing, stlink debugging would work.

Flashing Using OpenOCD (without Eclipse)

  1. Execute below command to convert ‘elf’ file format to ‘hex’ file.
    1. arm-none-eabi-objcopy -O ihex helloworld.elf helloworld.hex
  2. Starting openOCD
    1. /usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x_stlink.cfg
  3. Connect to openOCD and flashing
    1. telnet localhost 4444
    2. reset halt
    3. flash write_image erase /path2file/helloworld.hex
    4. reset

Enabling SFR Register Viewing During Debugging

  1. Help -> Install NewSoftware
  2. Add
    1. Name: SFR Viewer
    2. Location: http://embsysregview.sourceforge.net/update
  3. Select embsysregview and proceed for package installation
  4. In Menu bar, Window -> Show View -> Others
    1. Debug -> EmbSys Registers
Advertisements

From → Embedded System

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: