Skip to main content
josescxavier
Associate II
March 26, 2011
Question

STM32 Under Linux

  • March 26, 2011
  • 5 replies
  • 807 views
Posted on March 26, 2011 at 19:40

STM32 Under Linux

    This topic has been closed for replies.

    5 replies

    zexx86
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    Hi,

    You can find on the internet stm32 standard library with makefile, so you have to only add your sources and download arm compiler.

    domen23
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    I'm using Sourcery G++ Lite 2010q1-188 here. I had problems with a later free version.

    Also keep in mind the support for debugger/flasher. I don't think ST-Link works in Linux, so you'll either have to upload firmware through UART (ISP) or with a openocd compatible JTAG dongle (there are a bunch in 50eur range).

    Other than that, I'm happily developing on stm32 under Linux since 2008 :)

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    It's probably an uphill battle as there isn't the same commercial drive.

    As for a GCC/GNU compiler, the STM32 code can be built with CodeSourcery arm-2007q3-53-arm-none-eabi

    Lanchon, and Martin Thomas have done work in this area, so examples, makefiles and linker scripts can be found on the net.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrew Neil
    Super User
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    ''The only tricky part of using stlink-download is that it does only what you tell it to do.''

     

    I would say that's exactly how it should be!

     

     

    Far too many things try to be ''helpful'' (sic) by trying to anticipate what they think you want - but this just ends up getting in the way and making them inflexible!

    ''For instance, you must explicitly erase the Flash before downloading a new program.''

     

     

    A perfect example: it might think that it would be ''helpful'' (sic) to automatically erase the Flash before downloading - but that would then prevent you from doing anything that required, say, part of the flash to be left intact...!

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    donald2
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 14:29

    I typically use Ubuntu, and it was only a matter of downloading a few packages to get a working GCC compile environment.

    Working with the STLink was a different level of effort altogether.  I ended up looking at the protocol and writing my own 'stlink-download' program, which I've put up on Google Code.

    The only tricky part of using stlink-download is that it does only what you tell it to do.  For instance, you must explicitly erase the Flash before downloading a new program.