Nucleo ST32103 ARM Dev Board

From Wiki | OpenEnergyMonitor
Revision as of 15:00, 15 March 2017 by Bill thomson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Here are my notes to work with Nucleo STM32F103 dev board with built in STlinkV2-1 programmer under Ubuntu 14.04 LTS 64bit - Nov/Dec 2014


1. GNU ARM ToolChain

2. Eclipse IDE

3. STmicro libraries

4. GDB Server

1. GNU ARM Tool Chain $ sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded

(if using 14.04 follow extras steps when adding PPA)

$ sudo apt-get update

$ sudo apt-get install gcc-arm-none-eabi

if 64bit, we need 32-bit libs

$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

2. Eclipse IDE & ARM plugin

Check Java is at least 1.7

$ java -version

Choose IDE for C/C++ for 32 / 64 bit

Extract and run $ ./eclipse

Add c++ dev tools

Help → Install New Software > releases

Select 'Luna' eclipse release

Group by category > programming languages > C/C++ dev tools

Add ARM plugin

Help → Install New Software > releases

3. STmicro libraries


template makefile compile environment:

git clone git://

4. GDB Server

GDB Server - debugging - ST link is not native compatible with Linux however it's been reverse engineered:

git clone git://

$ sudo apt-get install libusb-1.0

$ sudo apt-get install autoreconf

$ cd stlink

$ ./

$ ./configure

$ make

$ sudo cp 49-stlinkv2-1.rules /etc/udev/rules.d

$ sudo udevadm control --reload-rules

$ sudo udevadm trigger

$ sudo ./st-util

GUI - QSTLink2

$ sudo add-apt-repository ppa:fpoussin/ppa

$ sudo apt-get install qstlink2

To flash code to the board


./st-flash write blinky.bin 0x8000000

ELF Executable Linkable Format

1. Start ST-link server on port 4242

$ ./st-util #check ST link is connected ok

$ ./st-util 4242 /dev/stlink

2. Start GDB and connect to ST-link server on port 4242

start an instance of arm-noneeabi-gdb

in a separate window and execute the following

$ arm-none-eabi-gdb BlinkingLights.elf

$(gdb) target extended-remote :4242

$(gdb) load

$(gdb) continue

Serial Output

Nucleo board serial output could be viewed by opening serial port on /dev/ttyACM0

To compile on Eclipse

1. Select new C++ project for STMF10x project

2. Check through default options

3. select blinky example

4. in BlinkLed.h change port number to be '0' for A and pin number to be 5 (on the necleo board the LED is on A5)

5. Click build

6. .elf file is now in the debug folder