Jump to content
gamersat678

The Ultimate Guide To Eclipse IDE based STM32F0 Programming

Recommended Posts

INTRODUCTION

 

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.

 

PREREQUISITES

  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....

 

post-197-135135494317_thumb.png

 

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

 

v1-2 Downloads

stm32f0_v2.doc

Share this post


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
http://openocd.berlios.de/doc/doxygen/bugs.html

Share this post


Link to post
Share on other sites

Errata:

board folder does truly not exist. Was a leftover folder when I was trying to get everything working. Don't need it.

Added a step to further clarify the creation of the custom run configuration OpenOCD Debug.

 

Oppa hope this helps.

Share this post


Link to post
Share on other sites

Oppa hope this helps.

Thanks but nope.

 

6530663666373831.jpg

 

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

Share this post


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
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Runtime Error: embedded:startup.tcl:47: Can't find ./boards/stm32f0discovery.cfg
in procedure 'script'
at file "embedded:startup.tcl", line 47 

 

Edit:

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:

Share this post


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?

Share this post


Link to post
Share on other sites

Well kinda, there are no more "xxx.h not found" but the demo from STM still does not build. Coocox seems to work for me but using windows sucks, sucks less than searching and adding include paths for hours though...

Share this post


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).

Share this post


Link to post
Share on other sites

hi, great tutorial!

On 7/26/2012 at 2:30 AM, gamersat678 said:

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

can you provide us a link to the new location?

thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×