Template for building STM32F0-Discovery project in GCC

Yep, that blue light is blinking and I made it happen. I’ve been hard at work since I got my free STM32F0-Discovery board in the mail. Most recently I put together a starting template for building STM32F05x project on Linux. You’ll still need to install your own tool chain (I’m using the Code Sourcery G++: Lite Edition), but this makes it a snap to compile your projects with support for STM’s peripheral libraries.

As for programming, you may remember that I added support for writing to RAM in the stlink project. I’ve wasted spent a ton of time trying to get support for writing to Flash into that project. It’s just less of a hassle to use stlink than it is to work with OpenOCD. But I’ve really hit a wall getting the flash loader code to work. If you want to check out what I’ve done so far in that area I committed a very messy branch (see the commits for what code changes I’ve made).

In the mean time you can use OpenOCD to write images compiled with the template to your device. I included the ‘make program’ option in the Makefile to do this from command line. If you need help compiling OpenOCD check the readme in the template repository.

17 thoughts on “Template for building STM32F0-Discovery project in GCC”

That’s awesome Mike. Projects on the Discovery kit are showing up slowly.
Also, I’m trying to build a small ARM community around all the Raspis, Discoveries and Beagleboards so it acts for a one stop place for all things arm.
Link is below.

I ordered an STM32F4 Discovery a few months ago as my first Microcontroller and I found it quite hard to use with free software on Linux. I still didn’t manage to use the STM lib with eclipse and had many problems with it in general. I recently tried chibios which seemed pretty promising especially with the hal, but it doesn’t really abstract the hardware that much, when you have to use specific register definitions that aren’t documented in the project…
I will definitely check out your forum akismet, but is there another page with good tutorials and examples (especially) for STM32 stuff?

Hi Mathias, We are still building the community up slowly. There is a discovery kits subforum if your interested. The board is fairly new and will take some time to catch on. I’m sure there will be a HAL soon enough.

Unsure why my name came up as “akismet”, I’ll change it in my profile later.

** (c)Copyright Atollic AB.
** You may use this file as-is or modify it according to the needs of your
** project. Distribution of this file (unmodified or modified) is not
** permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the
** rights to distribute the assembled, compiled & linked contents of this
** file as part of an application binary file, provided that it is built
** using the Atollic TrueSTUDIO(R) toolchain.

Don’t distribute the file but rather write instructions on how to modify the existing file a user would have if they registered True Studio . Dumb restriction but it can be bypassed. Good work on figuring it out.

I found these products to be a great deal. The Lida lida daidaihua makes me less hungry and the fat burn is helping me wipe out my flab. The instructions that came with it told me that getting my eating in check was necessary for a winning approach. I really took that to heart and have owned a lot more discipline when I am eating and the hoodia makes all that easier. I am doing sit ups and taking these products every day and so far, My flab is going away. I dont own a working scale but more than likely that things are improving.