This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

State machine vs RTOS for embedded systems

I stumbled across a free state machine tool for embedded systems here. The author claims that using his graphical state machine tool will result in code that is more maintainable than if an RTOS had been employed. This tool is based on UML which, while nice to know, has a steep learning curve. I would like to know what some of the more experienced embedded programmers think of this graphical tool.

  • RTOS and state machines have two completely different target markets. You can implement a state machine with threads in RTOS, and you can simulate an RTOS with a state machine. But using each for th ethings it was meant for, usually gives the better results.

    I implemented both and actually have bot independently of each other in the same project. The state machine handling SD card insertion in interrupt context, while the RTOS is switching parallel, independent task outside interrupt context.

    UML is good for complex state machines. As you can easily make mistakes for the different state transitions if you don't have a graphical tool (or a bunch of empty paper pages and lots of pencils). If the tool generates the code skeleton, it's even better.

  • Thank you, Jens-Michael for your informative analysis. Based on what you have stated, plus research I have done lately, I will probably stick with the tried-and-true state machine approach with a firmware flow chart maintained in parallel.

**Attention** This is a public forum