STM8S-Discovery: Microcontrollers Reach A New Low

A complete microcontroller development kit for little more than the cost of a bare chip? That’s what STMicroelectronics is promising with their STM8S-Discoveryseven dollars gets you not only a board-mounted 8-bit microcontroller with an decent range of GPIO pins and functions, but the USB programmer/debugger as well.

The STM8S microcontroller is in a similar class as the ATmega328 chip on latest-generation Arduinos: an 8-bit 16 MHz core, 32K flash and 2K RAM, UART, SPI, I2C, 10-bit analog-to-digital inputs, timers and interrupts and all the usual goodness. The Discovery board features a small prototyping area and throws in a touch-sense button for fun as well. The ST-LINK USB programmer/debugger comes attached, but it’s easy to crack one off and use this for future STMicro-compatible projects; clearly a plan of giving away the razor and selling the blades.

The development tools are for Windows only, and novice programmers won’t get the same touchy-feely community of support that surrounds Arduino. But for cost-conscious hackers and for educators needing to equip a whole classroom (or if you’re just looking for a stocking stuffer for your geeky nephew), it’s hard to argue with seven bucks for a full plug-and-play setup.

[thanks Billy]

223 thoughts on “STM8S-Discovery: Microcontrollers Reach A New Low

  1. @Miroslav An RS-232 or similar would be really nice. I’ll post on the forum later asking if this is included. I’ve also thought about this, it may be in there somewhere, but I don’t think so.

  2. I got mine and I am following the Help Home Page (tutorial) and get nothing but errors when I build. I’ve gone thru this twice. any ideas?

    Here’s the error (sorry abt the format):

    ———– Project cosmic_by_lou – STM8 Cosmic – Configuration Debug ————-

    Compiling main.c…
    cxstm8 -i”..\..\..\program files\stmicroelectronics\st_toolset\stvd\example\tutorial_stm8\step1_setup\src” +debug -pxp -no -l +mods0 -pp -i”C:\Program Files\COSMIC\CXSTM8_16K\Hstm8″ -clDebug\ -coDebug\ main.c

    #error cpstm8 C:\Program Files\COSMIC\CXSTM8_16K\Hstm8\mods0.h:0 FlexLM Invalid host

    main.c:
    The command: “cxstm8 -i”..\..\..\program files\stmicroelectronics\st_toolset\stvd\example\tutorial_stm8\step1_setup\src” +debug -pxp -no -l +mods0 -pp -i”C:\Program Files\COSMIC\CXSTM8_16K\Hstm8″ -clDebug\ -coDebug\ main.c ”

    has failed, the returned value is: 1
    exit code=1.

    cosmic_by_lou.elf – 2 error(s), 0 warning(s)

    1. Your COSMIC C compiler is NOT having a valid license file. Even if the compiler is free, you need a license file in order to operate. You can get the LICENSE free of cost by the company. To get license run this program
      “C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\LmregFSE.exe” it has a blue colour icon that says LIC

  3. I also changed from “I need one” to “nah, wait till programmer and assembler run under unixoids, or not at all” when reading about this, and will stick to AVR which are well supported with non-windows systems.

  4. With all the thanks and acknowledgments to hackaday.com for hosting this FIRST real thread on Discovery, it might be time that we move where other existing and potential users of this new toy (should) gravitate – ST’s discussion forum (at least, there ar no other places for now).

    I took a liberty (and time) to post my “Wish List” over there (http://www.st.com/mcu/forums-cat-9218-27.html), hope that people on this list that are NOT completelly thrown away by lack of UNIX support or dissaproval of anything that depends on Windows, or anything that goes back to Bill Gates in any form of fashion, will take a look, maybe even submit a comment or two.

    Looks to me that this platform, given support from ST, can move from a cool stuff worth spending $7 then never using it, to something worth considering.

  5. I got min the day after this post sample code works great, I haven’t done anything more then expanding the state machine for the LED flash but all the code looks goods I did go and download the actual libraries for the help file aka the only documentation on the libraries. this chip has 2 Uarts which is great. my site has pictures and a video of the demo code running and I’ll be putting up much more of my work after finials are over. I am using cosmic BTW and it does take about a day to get the license so try and be patient. and on the subject of debugging I cannot say enough, it is by far one of the better debugging systems for a device and programmer for $7.

  6. Hey everyone,

    I’m a big fan of open source hardware movements like Arduino and its many spinoffs, but it is nice to see something this inexpensive coming from a supplier capable of mass producing it.
    I picked up one of these boards, but have yet to really do anything with it since there are so few examples and tutorials available.

    Scratching my own itch for a community for this thing, I’ve set up a StackExchange site for STM8S Q&A:

    http://www.thingsopen.com/

    ST’s forum seems to be geared more toward experts, so maybe we can use ThingsOpen.com to rally hobbyists and answer more fundamental questions.
    If the board and mcu are going to gain traction among hobbyists (today’s students, tomorrow’s purchase decision makers), it will need to be as easy to get into and as welcoming as Arduino.

    Hopefully the community will build and ST will keep the price low.

    Cheers,
    Chris

  7. @patocheham @Mr Foo

    ST forums generally don’t have hobbyists like us. When HaD posted about the ST Primer2, I bought one. Went on to the forums… and everyone there are engineers with no time to instruct how to get started. Just like Chris said above!

  8. Under £5 from Farnell UK seemed more than a bargain but not so sure now. I am not a noob when it comes to micro development (PIC/AVR/ARM) but this is just too frustrating for words. Half the documents refer to different products, some things compile, some do not.

    If it were not for some encouraging work done here I would have tossed it in the bin by now – So a big thank you guys and gals.

    Arduino, Basic Stamp, PICAXE and Propeller all managed to create simple to use GUI IDEs which work almost out of the box yet ST cannot. If this was ever intended to get normal mortals into STM8s I do not think it will be a success. I can see the sales team already wondering: we sold a million in two days and have not seen an order since!

    Unless people like those posting here start writing good documentation and step by step instructions which work I think this is doomed to be the great bargain that turned out to be expensive landfill. Real shame.

  9. @ Ben Ryves

    Thank you, thank you, thank you !

    I took your zipped project, ran Ride, compiled and loaded the .Hex via STVP – Tada! Can now edit code and make the LED flash slower and faster.

    That is so much further than I’ve previously got, still some way to go but from acorns oak trees grow.

    Now why couldn’t ST have provided such an easy to use, easy to start with example??? If anyone from ST is reading here – take note!

  10. @Deeply Frustrated (and others)

    I have decided to put my exitment on hold for a week or two and give them (ST) a chance to catch up with documentation and code samples. Just today, I found two REALY nice additions to the repository (3BEEP and PWM). Kind of positivelly surprised with quality of the package (documentation, help file, package). Might be some truth in my thinking that they did hardware release to soon without having the “soft” side ready.

    In regards to STVD, I quite agree – very complex comparing to Arduino’s GUI, but man, options that one gets can’t be compared with Arduion’s offer. Debuger, registry browser, many other extras, realy look cool.

    Now, it’s questionable if most of us will realy need it or use it, but I can tell you, when I now go back to Arduino, I kind of, like it less then before :)

    Documentation is much better and BACAUSE of that much worst then comparable Arduino’s – I’m at the level that I like it KISS (Keep It Simple Stupid), but just reading the help file for 3BEEP I started to appreciate the depth that ST’s aproach brings.

    And by the way, Arduino’s library IS large, but not well organized. And often not accurate to my experience.

    If you ask me, I’m still having Arduino on my top shelf, if I need to do something quickly and dirty Arduino ruless, but I realy do hope that they (ST) will catch up with the soft side, and then, even at the cost of more complexity, I think that Arduino will become a little brother (in respect to the overall development experience with Discovery).

    Now, a shameless plug, if you get time, take a look at my post on ST’s forum (over there I’m under m_kisacanin). Hope some of you will agree and add comments – that might steer ST in slightly different direction :)

  11. Without wishing to blow my own trumpet too hard, I’ve posted a review and tutorial for the STM8S-Discovery to my website (click my name). Maybe this’ll help some people get started, let me know if I’ve missed anything out!

  12. @Ben Ryves
    Holy Wow. Your tutorial IS worth reading for sure.

    It took me form nop to fully blown interrupt controlled, timer managed, even address aligned blinker in a blink (pun intended)!

    To be serious, not having the link in the body of you message, I bet many will miss to take a look at your tutorial, and they’ll miss a lot!

    If you have some basic understanding of C and generic MCU knowledge, or if you are almost an expert, this 20-ish pages tutorial will for sure get you going with STM8S!

    Not sure that you’ll find dimming led controlled with touch sensor based key overly useful, but what will get you there will be a great first step and will enable you for so much more.

    Ben, I hope you won’t mind me posting the link on ST’s forum, it would be shame to lose track of such valuable contribution!

  13. with $7 I can buy discovery kit of a new powerful microcontroller with advanced set of peripherals (compatible with STM32) and very useful read while write feature. I used ST6/ST7 in the past and belive me this new microcontrollers platforms are more and more powerful!

  14. @Miroslav: Thanks for the comments, and I’m glad you liked the tutorial. Thanks for posting it on the ST forum, too! I acknowledge that the results of the tutorial are not especially impressive or useful on their own, but hopefully you can now find the documentation and samples provided by ST more manageable. I also wanted to avoid using any additional components, as I don’t know what people typically have in their parts drawer, and there aren’t exactly that many exciting projects that only use one LED and one input key, even if it is a fancy touch key. ;-)

    I imagine that as more people start using these devices more tutorials will appear and the learning curve will gradually drop down to one comparable to the ones offered by longer-established microcontroller families. As you mentioned, ST have put a few new files up recently, which is a good sign!

  15. who all the os elitism ? i use mac linux windows as necessary…run vmware server you can run all 3 simultaneously and interact your software like all 3 os’s were one use the best of each ..do you realise when you act like this your grouping yourself with starbucks drinking iphone toating coach handbag carying brandname brainwashed zombies who have been programmed to believe there “thing” is the best cause they have it and that makes them better than others

  16. Things are now getting better. It is certainly an uphill struggle when not familiar with the toolset.

    I have now got the Raisonance compilers running at the Command Prompt and have been able to cut the tool chain down from around 400MB to 12MB which may be handy for development on XP NetBooks or with Wine etc. I am now in a comfort zone so can concentrate on software development and having fun not worrying over tools.

    Could someone please create a wiki somewhere so there is a single point of focus for hobbyists which everyone can easily use and add to?

  17. I think I’ll buy one or two and give it a try.
    As for remarks about it being bad the compiler is limited to 16K that’s not really that bad as most projects for a controller like this will be under 16K.
    It’s a lot better then the lame 2k limit some companies give you for a demo.

  18. Seems to be one step forward two steps back at the moment.

    I have found a major bug in the code generation of the Raisonance RCSTM8 compiler but cannot find any contact info on the Raisonance site to report it — the link to use goes to a “contact page” which is not, and can not ( company policy ) use ThingsOpen to tell people about it because that requires OpenID.

    I am not sure how long I am willing to persevere with the current situation, especially as I have now realised the STM8S105C6 has only one port with a full 8 bits usable which is less than convenient for me.

    As I never wished to use hackaday as the place to bash the STM8S-Discovery I will say no more. If a community development portal does appear I will likely join it and discuss things further there.

  19. @Jason: The official STM8S forum (http://www.st.com/mcu/forumsid-27.html) would seem a good place to post your current gripes about the Raisonance compiler, to complement the existing gripes about it (namely that the official samples don’t work with it!) I only started with it as their registration process is automated, whereas I had to wait a while for someone to send me my Cosmic licence manually.

    If you can register the Cosmic compiler, life becomes a lot easier. The tutorial I published uses it, and I haven’t encountered any problems thus far. It won’t, sadly, fill in the missing bits on the GPIO ports for you though. ;-)

  20. @Nitori

    Actually, the 16K limit bites you hard if you code in C using the Cosmic C compiler (can’t say for the Raisonance one) and the ST-provided libraries. The reason being that there seems to be no dead code stripping; a naive port of chan’s fat file system code, using ST’s spi stuff, came to just under 16K. It shouldn’t be more than about 8k, by my reckoning.

  21. I’m terribly sorry, but I missed an important step in configuring the firmware library in the tutorial I wrote (defining the MCU type). I only figured out what was going wrong when I found I couldn’t use UART2, but spotted something fishy earlier when the CLK_GetClockFreq() was returning 24MHz instead of the correct 16MHz!

    The additional step can be found at the bottom of the “Adding the standard firmware library” section. I’ve added also a permanent link to the tutorial here – http://benryves.com/tutorials/stm8s-discovery/

    Sorry for any inconvenience!

  22. Looks like all I’m missing out on for the moment is some frustration, but does anyone know where to get one of these within a reasonable amount of time? My order with DigiKey got pushed back to 3/14/2010!

  23. Since this site has become a default forum for the Discovery I would like to offer an idea. The board’s twin rows of male pins make it difficult to use all of the pins. I have purchased a number of two row female IDC connectors (one for each end of a ribbon wire). I can now kludge all of the pins to a breadboard by inserting wires into the free end IDC. It makes for a messy board but all the pins are usable.

  24. Has the STM8S-Discovery community fizzled out ? There are a few who seem to be active but very little else, Farnell UK sales seem to have slowed to a trickle.

    It never was clear who the STM8S-Discovery was aimed at; a very attractive price but not overly hobby-friendly, and it doesn’t seem to have generated the momentum which might have been expected. Plenty of “wow” on pricing but little else seems to have come of it.

  25. I’m using STM8S discovery kits for my classroom, its low cost is very actractive compared Vs what is offered by other microcontrollers providers. Do you know alternatives to STM8S diskovery kit at the same price?

    SAL

  26. Hi gentlemen, I’m working for a big distribution company and up to now there are a problem to receive STM8S-Discovery from ST.
    ST has told that is necessary 2 months for cover all the request.

  27. Unfortunately, STM8S diskovery kit can’t give an idea of all the functionalities of this new 8-bit microcontrollers, STM8S evaluation board is better. I hope STM will sell evaluation board at lower price in the future.

    JOE

Leave a Reply to TroyCancel 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.