Skip to main content
whitewaterssoftwareinfo
Associate
April 13, 2012
Question

Working Example of Building/Linking code for STM32 with GCC ?

  • April 13, 2012
  • 8 replies
  • 1916 views
Posted on April 14, 2012 at 01:24

Hello, for months I've been trying to compile working code for my (generic) STM32 development board with the GCC toolchain, sadly with no success.

Does anyone have/know of a example of a simple project ie. blink an LED, on the web with makefile/linker script/etc. that I could potentially use to get started developing for the STM32 ?

Thanks !

-

post

heavily

edited 4/14/2012 at 9:31am EST
    This topic has been closed for replies.

    8 replies

    frankmeyer9
    Associate III
    April 14, 2012
    Posted on April 14, 2012 at 15:00

    You could try this:

    http://

    It works (at least, it worked for me; I could build and debug a simple example).

    However, they obviously took header files and linkerscript from the Atollic toolchain.

    carl2399
    Associate III
    April 14, 2012
    Posted on April 15, 2012 at 01:32

    Hi,

    Sorry about the lack of success! Maybe my story will help. Using WinXP and Win7.

    I started with the Raisonanse RIDE development environment which uses GCC as it's backend - which worked fine for compiling STM32 applications. I wanted to move away from the IDE to makefiles (and also to C++), so downloaded the Yagarto port of GCC and tools. I could not get code to run when compiled under Yagarto. The source was identical, but I suspect that the Yagarto was pulling in some non-thumb code.

    So, my current compile environment is the Yagarto tools (make, rm, cp, touch) combined with the Raisonance port of the GCC compiler, with all compilation managed using makefiles. There where further complications to get C++ working, but that is another story.

    Best wishes,

    Carl.

    jado
    Visitor II
    April 15, 2012
    Posted on April 15, 2012 at 17:38

    Look at this:   http://www.freddiechopin.info/en/download/category/6-examples 

    infoinfo989
    Associate III
    April 16, 2012
    Posted on April 16, 2012 at 04:50

    I've had no problems with Yagarto (under WinXP):

    http://www.yagarto.de/

    There are many example projects as well there, including ones for STM32.

    trevor23
    Associate III
    April 16, 2012
    Posted on April 16, 2012 at 13:57

    Of the ''free'' tools I've played with for STM32 Coocox is the only one I'd recomend. For an IDE based on eclipse they've done a really good job.

    www.coocox.org

    For my professional work I use a bought in tool chain (Crossworks) as so called ''free'' tools can be expensive if you value your time.
    frankmeyer9
    Associate III
    April 16, 2012
    Posted on April 16, 2012 at 15:03

    The CoIDE (and the rest of the CooCox tools) is Windows-only, which might not be an hindrance.

    The CoIDE is more targeted to beginners - this is especially obvious in the debug options and settings, which are very limited, compared other IDEs. If you don't need the yet quite experimental M4 support, it works well. Some other controllers and debug adapters are supported, but the list appears somehow random. The CooCox RTOS also seems to be in an experimental stage - it fails with optimization level > 0.

    But generally, it is worth a try.

    hfs99
    Associate II
    April 29, 2012
    Posted on April 30, 2012 at 01:08

    I realize this thread is getting a little stale; I doubt it will help the O.P., but I put a couple of minimal Makefile examples (with minimal instructions) at

    http://www.overtracks.com/stm32/baby-steps.htm

    By the way those are some excellent links Gloryman. Thanks!