ARM Prototyping On-the-cheap With STM32 Discovery

STMicroelectronics has another inexpensive development board out; the STM32 Discovery is an ARM Cortex-M3 prototyping platform. Coming in under $10 puts it right along the lines of their 8-bit offering, but this one is 32-bits with 5 KB of RAM and 128 KB of programming memory. It runs a bootloader and has on-board USB for easy programming. They’ve even got a trio of crippled IDE’s to get you started.

Unfortunately this is following a growing trend with the exclusion of Linux support. [Gordon] wrote in to let us know that there is hope in a couple of forms (but not using the USB functionality). The first is a serial programmer using the RS232 that [Paul] came up with (there’s a lot more on his blog so spend some time there). But you can also use the serial debug protocol to program the board.

Either way you’ll still need a method of compiling the code. We’ve had great success rolling our own GNU ARM cross compiler using this guide. Or you can grab a pre-built package by downloading Sourcery G++ lite.

50 thoughts on “ARM Prototyping On-the-cheap With STM32 Discovery

  1. This thing is far away from being a computer: no MMU, no SDRAM, no ethernet, no wifi, no video, no…thing.
    It’s no shame, it’s just a muscled micro-controller, otherwise it wouldn’t be dirty cheap.

  2. I was really confused when I read lack of Linux support… Well yea it only 5k of ram… Oh you meant for development.
    These are some really cool devices. Since they are for evaluation they are probably being sold at cost. That is probably why they are not supporting Linux. The do not want a lot of hobbiests buying these instead of basic stamps and arduinos.

  3. “This thing is far away from being a computer: no MMU, no SDRAM, no ethernet, no wifi, no video, no…thing.”

    You do realize those exact same things could be said about the Apple ][, right? For that matter, “back in the day” we would’ve *killed* for 128k of program memory.

  4. @KC8RWR
    My guess is developers. They are hoping that people will use these and start designing them into products. At $10 or less it is petty cash. Think of these like “samples”.
    I could be wrong but the margin would be so small that they would have to sell a huge amount of them to hobbyists to make a profit.

  5. Apart from the lack of proper networking, none of those other things stops it from being a computer. A terminal is perfectly adequate for a lot of stuff. I think the 5k of RAM holds it back in the controller realm too tho.

    For a few dollars more, a PIC32 dev board with USB to go, 512k flash and 128k of static RAM can be had which has equally useless Linux support out of the box :-)

  6. In my entire time working on stuff that pushes electrons around, I have seen a lot of good, bad and beyond ugly

    I am going to unashamedly consign this board and it’s software associated crudfest to limbo pending their showing some trace of a clue RE: what makes Hackers swear by or AT. ST, this means what it says and says what it means.

    HAD is read by a major number of folks that can recommend- or discourage buying from a company.

    Arduino, LillyPad etc are examples of what both being Open and Mindful of the customer can do for market share. Customers that feel desired and cherished by a company quickly go from customers to Evangelists!

    As with many other situations, the total reversal is even more swiftly dramatic.

    Oh, I might have considered this STM32 as something to keep my skills fresh or use in some future project. as it’s price point. Then I tripped across some FAILS of crippling STUPIDITY. As when I was fact checking the good and the bad of this STM32 board, I found a truly stunningly **UGLY* and EPIC FAIL relating to it:

    They may have a legal “right” to do Clue Lacking stunts like disabling older versions etc.

    I feel it my ethical DUTY to warn Hackerdom of their stunning bad. IF they want to have any respect from ME? They=both Raisonance and by extension/association ST might start by reconsidering what having an evaluation version download disable the existing products of that company earns them. Yeah- it’s their code base and their legal right to do what they will with it. Including making deal breaking conditions on code downloads.

    But for the love of Entropy- do please get a clue eh?

  7. lwatcdr: “My guess is developers. They are hoping that people will use these and start designing them into products.”
    Who the hell would want to use a breakout board in their product? Professionals don’t design products on veroboards and headers that connect on top of arduino.
    If they want to use some microcontroller, they will buy trays of raw, unsoldered chips and design a circuit board that has all of the necessary components to run the micro.

  8. @Myke: Professional do design products on modules and breakout boards. It allows you to quickly develop and test. Trays of raw chips and custom PCBs come later, when the basic hardware requirements have been hashed out and you’re getting ready for volume production. And of course STM wants you to be using their chips at that stage – and the idea is that having a cheap easy module will get you to use their chips (that the module itself is not profitable is entirely besides the point.)

  9. Myke and others: lets not forget that “professionals” are often called upon to design and build one-offs all the time. They are essentially “finished prototypes,” which often have off the shelf modules to save time, make debugging easy, and cut down on board manufacturing.
    It is rarely ecenomical to send out for a single board. More true when you have to lay out additional circuits from a module, when you can just lay out connections to module headers instead.

  10. i’m glad someone posted a link to something on leaflabs..

    their toolchain for the arduino-compatible Maple board can probably be made compatible with this Discovery board without too much trouble.

    check them out at (and no, i’m not affiliated with them other than being interested)

  11. @MRE,
    You just described the last 6 months at my job. We used 4 breakout boards to do 4 different “finished prototypes” that were sent out to market. Then the client sends the prototype to be properly finished by someone else when they are given the funding to mass produce.

    That said, this board is not much less powerful than a Maple and it’s only ~$12 (Under 10 bucks is a joke, as shipping is close to $20 in the US)

  12. Good lord people, get a grip.

    @”3 cripped IDEs!” … It’s the compilers that are crippled, and the only limitation is code size. The free versions will still give you more than enough to play around with for hobby purposes. The IDEs themselves are, for the most part, fully functional (some of them lack the really advanced debug features, but they’re fine for personal work.)

    @Oren Beck: what are you going on about? If you don’t like how Raisonance manages their free trial versions, use one of the other two officially supported toolchains, or find your own. I don’t think it’s logical to slam ST for something that’s really got nothing to do with them. If Raisonance or anyone else did the same thing for an Atmega8L compiler for the oh-so-shiny-paragon-of-hackerdom Arduino boards, would you rage against Atmel? Not that I’m defending ST in particular here, the same goes for anyone.

    Yeah, the compiler limitations annoy me too. But as an embedded designer by trade, I can tell you that’s just how it is. The trial versions do give you enough of an idea to know whether or not you’re going to use the particular chip family for a project, and if you are, you can justify the cost to buy it.

    Keep in mind the target market here: They were literally _giving_ these things away free at ESC a few weeks ago – I got one one of them, as well as one of the STM8L boards – they had huge bins of them. They’re targeting professional designers who will use these in mass-market products, 50K+ units where the economy of scale will take over.

  13. The problem with this (and sadly many other similar) threads is the number of uninformed commenters.

    The toolchain links on the product page are *advertising*.

    The STM32 is a CortexM3. That means that you can use the same toolchain(s) for it that you would use for any of the piles of CortexM3 cores from Luminary/TI, Actel, NXP, Toshiba, Atmel, etc. etc.

    On top of that, ST provide both the DPA and CPA layers for CMSIS as a free download, so there really is nothing “crippled” about the device at all.

  14. @Mike

    >> The problem with this (and sadly many other similar) threads is the number of uninformed commenters.

    On hackaday, it’s always September.

    Sure, the linked toolchains are all crippled one way or another, but that’s no big deal – they are commercial packages, after all, and the toolchain companies need to make their money somehow.

    As has been pointed out, there’s nothing stopping you using GCC / GAS, though. Or any other free toolkit.

    About the only thing I *can* point the finger at ST for is making the ST-Link tool windows-only. That sucks, but, again, it’s not a dealbreaker.

  15. Everyone should note that this is a demonstration board for ST’s value line STM32 chips which are around $1 in single quantities. The entire line of STM chips includes the approximately $10-$15 STMF103RE chip which has 512K flash and 128K ram. I have been working with the STM32 Stamp on Futurlec and the STM32 Dev board (

    These are really nice chips. There’s a pretty steep learning curve, but they have a lot of power.

    As A couple people noted, the Leaf Labs uses the same line of chips on the Maple. This has a port of the Arduino framework and IDE. If you are more comfortable in that environment, or if you just want to see stuff working immediately I recommend you take a look at their work.

  16. Considering the selection of chips ST offers and an early checkup, it might actually be relatively simple to replace the meager STM32F100RB from the board with a STM32F103RE (512kB program, 64kB RAM, 72MHz) or a STM32F107RC (256kB program, 64kB RAM but with ethernet MAC and other goodies built-in). The matching packages (LQFP64) have the exact same pinouts and base pin functions, with the extra optons available through general IO pins with some reconfiguration. Replacing the chip with higher-power ones would cost about $10-$15 from what I could find out.

  17. @Someone:
    Good luck. The debugger shows up as a semibroken SCSI device

    The windows dll(STLinkUSBDriver.dll) sends custom SCSI commands to it using passthrough communication. Since the Linux driver doesn’t handle those(I didn’t succeed) you would need some driver that can actually send custom sequences

    Oh, and a heads up; the driver seemingly isn’t stable on 64bit windows

    There’s more information on the my.ST forums:

  18. Hi. Thanks for the heads up for the blog :)

    Of the three IDE compilers the Atollic one is the best, being unlimited. Unfortunately every time you compile/link/program it puts up a stupid alert box imploring you to buy the real thing which gets on your nerves in seconds.

    I don’t think ST have thought it out properly. They didn’t with the 8 bit board either. No real pro is going to be bothered about it being $10 – the only way I can see it making sense is as an ARM Arduino. The aim is not to get current pros using it, but to get the next generation and hackers using it. How much will the use of Arduino do for AVR sales medium/long term – it provides an easy way in, and you can develop it further (you can write AVR code with Eclipse say), and it’s bomb proof (mostly) ? It was a pig getting the STM8 board to work, even under Windows, and it’s not much better for the STM32. Three different IDEs often with horrific registration and sign up code, and starter code that too often doesn’t work. Arduino – download the IDE, install Java (maybe) and go. People who buy an STM32 to play with won’t ever shell out $xxx for a professional IDE.

    It’s the same reason MS provide free versions of Visual Studio. A pro developing C# won’t bother with it, but it provides a lot of colleges, hackers and the like with experience of MS products.

    Meanwhile developing on Windows is a pain, and Linux is worse (mainly because of the hardware requirements – and the hardware is already there, it just doesn’t work properly – all it needs is a proper jumper for BOOT0 and the Serial I/O on the STM32 to be mapped onto the USB port).

    The driver isn’t stable at all. The ST8 board wasn’t either. It doesn’t follow the specs for a USB memory device properly, hence it continually resets under Linux. It just works under Windows, but only just – but all they do with it is provide HTML files linking to documents on the ST website. Why on earth not have (say) the flash on the STM32 as a file there, so you can program it by overwriting that file, bit like the MBED.

  19. What do you guys mean no linux support? I develop for this thing on a daily basis under Linux.

    IDEs are overrated, use vim, you will find it hard to start with, but once you learn it you will never look back

    And for those that read that and are about to try to bash vim, I daily develop for XBMC using vim as do a number of the other developers, so don’t try to tell me vim is no good for a large project.

    As for flashing, yes, there WAS no Linux support (or very little) until I wrote a flash tool for it…

    Mind you, I have since learnt that JTAG programming and debugging with OpenOCD is worlds above the serial programmer.

    High level languages such as C#, are such a waste of resources on this little device.

    There is a precompiled cross compiler available here which works flawlessly:

    Your in the world of embedded, if you want to use it properly, learn about cross-compilers, learn how to use makefiles properly, and learn how to use an editor such as vim.

  20. @MysticPixel: The “what are you going about” comment is deserving of a fair handling. Yes, you have pointed out diverse work-arounds or alternates for the toolchain. Perhaps the concept of guilt by association is edgy in some elements- or is it? Here’s my simplest explanation for that warning.

    I am not contesting the “rights” of Raisonance to handle their revenue models and IP policies as they see fit. I wish them nothing but good sales. Hopefully good enough that they come over to the Free Side where many categories of Ulcers and nightmares go away :)

    Same applies to ST for being associated with Raisonance or any software/firmware sources they see fit to.

    The single deal maker or breaker is that “disable what you already have” concept. Do please recall the Sony “Rootkit” incident and what aftermath it had. Frankly speaking- Would any of us really want to give a good recommend, let alone OUR money to a company that has such IP policies? If it’s any doubt as to how a first reading says it?

    Folks, it’s a case of Informed Participation, to create another acronym. My main concern is that if we are not careful, we risk things like hitting the other download page first:

    Which would not clearly show the warning on the other page. Nor would we have seen that this is a company that uses Sentinel Dongles etc..

    Again- they have the ethical and legal “right” to handle their IP however they see fit. In an ethical world where no one would violate the stated permissions of an IP owner EVER, Perhaps all such discussions might become null.

    Or? The concept of truly Free and Open both in source and financial has some very compelling BIG wins. Every time any of us choose to recommend a company we’re essentially saying we approve of them. I do not approve the concept of entangling the hardware with very unfree companies, even at the “present” distance between ST and third party developers etc.

    Just because it’s within their rights to do what they will with their code- it’s within my rights to respectfully say NO to Dongle Locks etc. The reality is that Free Distribution turns what would be a “pirate” into your Crowdsourced PR worker! And from that concept of Worldview Hacking= Preaching the Gospel of F/OSS I close by directing anyone with doubts to look at:

  21. Over the last two days I have built a basic website that contains articles on how to use the STM32 under linux, from setting up the cross-compiler to setting up and compiling your first project.

    There is even a skeleton C project that is ready to go with the latest version of the ST library linked in.

    This is all available for free at:

  22. Incredible! How is it possible to have on the market a so low cost 32-bit microcontroller family (up to 512k) based on CORTEX-M3? Are they loosing money? CORTEX-M3 has more performance of Von Neumann based CORTEX-M0, how does can be its cost so low? All microcontrollers of this class have not the value line performances in terms of DMIPs and set of peripheral!

  23. Geoffrey McRae has setup all his pages but I still do not see how that lets me debug this board. I still am stuck with a broken windows only interface on this board as far as I can tell. Did I miss something? I already have the cross compiler chain installed for other devices I use, but to use this board I don’t see how to get things loads without a windoze box, and I don’t currently have one of those. (I rarely miss it, expect for losing things like this that don’t a clean interface.) I have dfu and dfuse tools working, and several other tool chains, but this board seem useless without better support.

  24. Wow, dudes, just got mine, packaged nicely and waiting for me :) I ordered on the 14th and my project number was 9xx so I guess they still have some boards around. Can’t wait to start prototyping.

  25. Actually it’s a terrific board and the only thing
    missing for a totally Unix based development environment is a gdb server. The atollic one
    works fine in a windows VM and communicates nicely with a Unix based gdb (7.0 or earlier it seems). I use OS X, but linux would be slightly easier on the tool side.

    gdb works fine for flashing elf files, so no need for a separate downloader. Also, the st-link based debugger interface seems pretty robust. Lots of stuff that never worked right for me with openocd talking to an ARM7 or MSP430 works flawlessly with gdb through st-link.

    There are a few issues with the build environment for the demo code, but those are easily overcome. On needs a linker script and a startup file. The startup files distributed with the board hang trying to init libc — I just commented out the appropriate line. All this is dscribed here:

    GDB was great for tracking down that libc problem !

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.