26 Replies Latest reply on Nov 8, 2017 7:11 AM by Vyacheslav Azarov

    Should we hope for long-term use of stm8?

    Vyacheslav Azarov

      Hello everybody,

      Recently, the company has been actively offering to transfer your projects from 8-bit micro-controllers to 32-bit ones. In view of this, I had concerns about the feasibility of future developments with the use of STM8. I like these efficient and inexpensive processors, and I would not want to lose this engineering resource in the near future. If anyone can, anything, say about this, then please participate.

        • Re: Should we hope for long-term use of stm8?
          Clive One

          To be honest the dynamics in the semi industry have changed in recent decades, if the line remains profitable, and the fab and test equipment don't break down, or get overwhelmed by natural disaster, they are likely to continue, but when said variables turn you'll be out of luck.

           

          Realistically one would need to be adaptive, vastly more engineering resources and fab space are being allocated to the ARM/Cortex designs. The CM0/CM0+ being targeted at 8051 and other lower running 8-bit cores, and for compiler/tool vendors the 8-bit parts are pretty brutal targets, and least profitable.

           

          I'm not saying abandon any platform, just be sufficiently nibble, and prepared to port your work, and have a mindset of writing more portable code.

           

          Look for parts with a "10-Year Guarantee" if that's the time scale you need.

          2 of 2 people found this helpful
          • Re: Should we hope for long-term use of stm8?
            Philipp Krause

            I've heard from STM8 users that ST was encouraging them to move to STM32 years ago already. On the other hand, ST is still releasing new STM8 devices (like the 8-pin devices this autumn). From the outside, it seems like there are different factions inside ST wrt. this question.

            I guess the STM8S001 being popular far beyond ST's expectations (as can be deduced from the availability at distributors after launch) might help secure a future for the STM8.

            Personally, I'd prefer if there was a second source for STM8 devices. The 8051 are still produced by many companies, even though Intel stopped making them long ago.

             

            On the compiler side, SDCC and related free tools are improving. For C developers, I'd expect the the STM8 toolchain situation to look quite good for a long time to come.

             

            Philipp

              • Re: Should we hope for long-term use of stm8?
                Clive One

                For ST the key advantage of the STM8 is likely they don't have to pay royalties on the design, and patents on ideas/concepts other might have claim to have expired.

                 

                Good tools don't suffer from bit-rot, the platforms they run on may lose support (DOS, Win16), I've got tools from the 1980's and 1990's I can still run and generate code just fine. I've also ported things and rebuilt DOS Extenders, and Linker/Object tools to migrate abandon-ware to run on current equipment, it's not impossible and some people can still do it. Getting support from tool vendors may be very difficult. Just be conscious that the longer you stay with a technology the more of the support/cost burden you will need to shoulder yourself.

                • Re: Should we hope for long-term use of stm8?
                  Thomas G

                  Seen the competition from low-end ARM cores one might argue that the air for High- and Medium-Density STM8 devices is getting thin. For large scale products royalties play a big role, and the circumstance that the low-density family includes automotive devices makes it likely that excess capacities will continued to be marketed as commercial products in the foreseeable future (including Value Line devices). Replacing the µC in a consumer product with 2 years useful life is easy - getting out of 10 year delivery obligations of an automotive product not so.

                    • Re: Should we hope for long-term use of stm8?
                      Clive One

                      >>Replacing the µC in a consumer product with 2 years useful life is easy - getting out of 10 year delivery obligations of an automotive product not so.

                       

                      Still, even with multiple sources there are a whole bunch of "Game Over" situations, especially with older technology, or things which have unique or exiotic features.

                       

                      You should have contract clauses that protect you from things which are outside your control. ie Natural disaster, failure of suppliers, etc.

                        • Re: Should we hope for long-term use of stm8?
                          Thomas G

                          Clive One, I guess you're right. However, the point is that automotive companies already negotiated such clauses, and Joe Small-Scale won't need to worry too much (and it's safe to assume that the automotive purchase departments know their business well). I once worked in an SME, and natural disaster events that had an impact on availability of critical components happened about once in 4-5 years. Using parts primarily used in "automotive" allowed production to continue, even if it was sometimes difficult to get components. Of course, it's wise to always have the next design ready, and to manage hardware dependencies well (e.g. with some kind of abstraction layer) but at small scale that's easier said than done, and using µCs with a primary automotive market mitigates some of the risk.

                    • Re: Should we hope for long-term use of stm8?
                      pavel a

                      My 2C...  Just recently joined a new project involving a STM8L.

                      They choose it only because they started from a 3rd party reference design based on that chip. Not because of cost of the chip.

                      A 8-bit micro is good for one-person projects.

                      With STM8, I have to roll a fragile patchwork of interrupts and "super-loop", hard to accommodate for other developers.

                      If they could use 32-bit ARM, it would be possible to bring in a decent RTOS, which is very useful to coordinate work among several developers (break functionality to "tasks" & rich common infrastructure).

                      We also consider dangers of proprietary STM8 toolchain vs what is available for ARM. The only opensource compiler there unfortunately is not supported by any GUI which is no-go for the team. (this can be done, but who has extra time? or money?)

                       

                      Back to the original question - is there still a niche for 8-bits - IMHO only a EE can answer this. 

                      8-bits are low-density which means more resistant to radiation and temperature. But does this difference matter? can it be compensated by shielding?

                      Power consumption of ARM M0 is not much higher than STM8 (especially 8L)  but for some applications this difference can be critical too.

                       

                      -- pa

                      1 of 1 people found this helpful
                        • Re: Should we hope for long-term use of stm8?
                          Philipp Krause

                          Currently, I am not really a RTOS or IDE user. However:

                           

                          Indeed, ARM has much better RTOS availabilluty. But there are a few RTOSes for the STM8. Depending on your requirements they might or might not do for you. Atomthreads seems like a reasonable choice, especially due to your concerns about the toolchain situation: Atomthreads supports all 4 toolchains for the STM8 (SDCC, IAR, Cosmic, Raisonance).

                           

                          Especially in IDE support and on-target debugging, the free toolchain is not yet up to the standard of the non-free alternatives. However, it is improving rapidly. If you write portable code today using a non-free toolchain, it should be easy to change to different free or non-free toolchain later.

                           

                          There is a project for on-target debugging for SDCC and STM8 using gdb and the Eclipse IDE. From what I've heard on a German-language µC forum it already works quite well. SDCC 3.7.0 will have even better support for this via improved ELF/DWARF debug info output.

                          The Code::Blocks IDE has support for SDCC (when I installed and started Code::Blocks a few minutes ago, it detected the installed SDCC, and gave me a choice of GCC vs. SDCC to use as the default compiler for new projects). However the SDCC support in Code::Blocks was written for older SDCC, which shows. Updating it for current SDCC seemed easy, so I submitted a patch. I hope it make it into the next Code::Blocks release.

                           

                          Some use SDCC with NetBeans and Anjuta, but I don't know if there is any support for SDCC in those IDEs or people are just using plain Makefiles with their projects.

                           

                          Philipp

                            • Re: Should we hope for long-term use of stm8?
                              Vyacheslav Azarov

                              'Context-free' compiler for 'registers-free' processor it is good idea.  I would use the SDCC to build my experimental multitasking kernel, but some of its particular properties are not enabled to do this so until now. Currently, I give the advantage to COSMIC software. In view of the free license and high-quality code optimization. I think that if successful, I will make a port for the SDCC, also.

                              • Re: Should we hope for long-term use of stm8?
                                pavel a

                                Philipp,

                                Thank you for RTOS suggestions. Atomthreads looks good, but with at most 2K RAM size, its use of RAM for stacks may be prohibitive.

                                 

                                About IDEs - the only important aspect for us is a visual debugger. To edit and build, we can use any decent free IDE - even Visual Studio  but because of the debugger we stick to STVD. Cosmic seems to have their own debugger, but it is not included in their free STM8 package, even as trial. Which means, costs, licensing nuisance and so on... not a deal when we have a free and decently working debugger.

                                 

                                -- pa

                                  • Re: Should we hope for long-term use of stm8?
                                    Philipp Krause

                                    Work on having visual debugging in the free toolchain is progressing.

                                    For now, there already is STM8-BINUTILS-GDB  which allows on-target debugging from the Eclipse IDE.

                                     

                                    There are a few issues, most notably regarding local variables allocated partially to registers, which gets worse with higher optimization levels; also the generated code is somewhat different from the one without debug info. But in general it works.

                                     

                                    Work is in progress on solving the remaining issues (most are already solved in the source repositories). I guess that on-target debugging will be fully working before the end of the year. Also from within Eclipse and Code::Blocks.

                                     

                                    Philipp

                                      • Re: Should we hope for long-term use of stm8?
                                        Vyacheslav Azarov

                                        Sorry for invading your dialogue. It would be great if it all worked. I like CDT. I highly appreciated it when using Ac6 System Workbench. However, the generator of the  code of the SDSS for STM8 desirable to significantly improve. May be I do not known the magic word?

                                          • Re: Should we hope for long-term use of stm8?
                                            Philipp Krause

                                            1) All compilers will be good at some code and not so good for other (see e.g. Any atomic I/O bit access functions for STM8L?  about such an issue for Cosmic). While ideally compilers would generate very optimized asm for all C input, in reality it helps to know a bit about what coding style the compiler likes and generates efficent code for.

                                             

                                            2) Since SDCC is improving rapidly, it helps to use a recent version (the SDCC 3.6.0 release was over a year ago; there will probably a SDCC 3.7.0 release later this year), development versions are available as binary snapshots and source.

                                             

                                            3) For a lot of code, the magic word is: --opt-code-size --max-allocs-per-node <value>. Where <value> is some big number. The default is 3000. Larger values make SDCC optimize more (but slow down compilation).

                                             

                                            4) If you have a compileable, small code example, where you think that SDCC generates particularly bad code, you can open a feature request at Sourceforge. This might lead to an improvement in SDCC (while sometimes feature requests get implemented quickly, others stay in the tracker for years without anything happening).

                                             

                                            Philipp

                                      • Re: Should we hope for long-term use of stm8?
                                        Vasile Guta_Ciucur

                                        eclipseSDCC download | SourceForge.net 

                                        There is an Eclipse plug-in for 8051 target that can be easily modified to target STM8 (I did it for PIC18F46K22 just by changing the configuration files Better C18 Library: Eclipse SDCC )

                                    • Re: Should we hope for long-term use of stm8?
                                      Laurent VERA

                                      STM8 is a product with a 10 years longevity commitment from ST. We typically renew this longevity commitment at the beginning of every year. We recently introduced new 8 PIN STM8 device . STM8 volumes keep on growing, the product is very successful.

                                      2 of 2 people found this helpful