Jump to content

The Ultimate Guide To Eclipse IDE based STM32F0 Programming

Recommended Posts



This guide's intent and purpose is to allow a user with minimal Linux experience to successfully setup an absolutely free development environment to program the STM32F0 microcontroller with full debugging capability.



  1. A Linux distro, I used Linux Mint 13 (Ubuntu works nicely too)
  2. An Internet connection
  3. At least 2gb of spare hard drive space
  4. Familiarity with terminal
  5. A STM32F0 Discovery Board!

PART 1 – Install Codesourcy

PART 2 – Install OpenOCD

PART 3 – Install Eclipse

PART 4 – Setup File Directory

PART 5 – Setup Eclipse

PART 6 – Configure the gdb/OpenOCD


Hope you enjoy! Any questions, comments, feedback, feel free to sound off below.Also a STM32F4 guide is on its way. When it gets here depends on how much spare time I have....




Edit: Thanks bluehash! Guide is now hosted on arm-hq.


v1-2 Downloads


Link to post
Share on other sites

Dead end again. :unsure:


Part 4.9 Copy stm32f0-discovery-basic-template/board/ folder to...

There is no board folder.

oppa@siductionbox:~/git$ ls stm32f0-discovery-basic-template/
Device extra inc Libraries Makefile README.md src


PART 6.1 Under Debug Configurations ensure your values match these

There is no OpenOCD Debug

oppa@siductionbox:~/git$ openocd -v
Open On-Chip Debugger 0.5.0 (2011-08-09-08:45)
Licensed under GNU GPL v2
For bug reports, read

Link to post
Share on other sites

Oppa hope this helps.

Thanks but nope.




I'm using the Debian package of openocd and thought that may be the problem, so I tried to build openocd like you described but this is just another fail.


oppa@siductionbox:~/git$ git clone http://repo.or.cz/r/openocd.git
Cloning into 'openocd'...
oppa@siductionbox:~/git$ ls
openocd  SimpleIDE-0-8-1  stlink  stm32f0-discovery-basic-template
oppa@siductionbox:~/git$ cd openocd
oppa@siductionbox:~/git/openocd$ ls
AUTHORS		    config_subdir.m4  guess-rev.sh  NEWS-0.3.0    src
AUTHORS.ChangeLog  configure.ac	  HACKING	   NEWS-0.4.0    tcl
bootstrap		  contrib		   jimtcl	    NEWS-0.5.0    testing
BUGS			   COPYING		   Makefile.am   NEWTAPS	   TODO
ChangeLog		  doc			   NEWS		  README	    tools
common.mk		  Doxyfile.in	   NEWS-0.2.0    README.Win32  uncrustify.cfg
oppa@siductionbox:~/git/openocd$ ./configure --prefix=/usr --enable-maintainer-mode --enable-stlink^C
bash: ./configure: Datei oder Verzeichnis nicht gefunden |-> file not found
oppa@siductionbox:~/git/openocd$ ls doc
fdl.texi  INSTALL.txt  Makefile.am  manual  openocd.1  openocd.texi
oppa@siductionbox:~/git/openocd$ less doc/INSTALL.txt
oppa@siductionbox:~/git/openocd$ less README
oppa@siductionbox:~/git/openocd$ ./bootstrap
+ aclocal
./bootstrap: Zeile 27: aclocal: Kommando nicht gefunden. |-> command not found

Link to post
Share on other sites

So, managed to get a bit further. To build openocd I had to install libusb-dev and automake.


Now I've tried to compile the demo firmware of the STM32F0-Discovery board. Although stm32f0xx.h is there and even opened in eclipse:

../src/STM32F0-Discovery_FW_V1.0.0/Utilities/STM32F0-Discovery/stm32f0_discovery.h:38:23: fatal error: stm32f0xx.h: No such file or directory
compilation terminated.



I started debugging manually aaand:

Open On-Chip Debugger 0.6.0-dev-00640-g40801d2 (2012-07-30-12:01)
Licensed under GNU GPL v2
For bug reports, read
Runtime Error: embedded:startup.tcl:47: Can't find ./boards/stm32f0discovery.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 47 



The last one was easy, the path is ./board/..

stm32f0xx not found was my fault, I forgot to add one iclude path. The next compiler run yelled core_cm0.h not found at me. I found it and added another include path. Now I get stm32f0xx_conf.h not found. :rolleyes:

Link to post
Share on other sites

Yep need the dev openocd as since v6 only includes stm32f0. No other version has it.


Sorry for forgetting libusb-dev and automake. Those must have already been installed with my stm32f4 stlink installation.


Make sure you have added the includes to both GNUC and assembly in step 5 part 4.

Also make sure to "Copy stm32f0xx_conf.h from an example project in the STM32f0 firmware package to the Template/src/ folder"

And you posted a screenshot of the debug configurations. Do you have a problem with configuring the debug configuration?



Get any further?

Link to post
Share on other sites

What's the error message? With my guide there should be minimal folder/file movement and only 14 includes (7 GCC[4 workspace, 3 codesourcery], 7 Assem[4 workspace, 3 codesourcery]). Like I said, I was able to get it working in Linux, and I documented it along the way (guide=documentation).

Link to post
Share on other sites
  • 6 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...