Live data from Hacker News

Show HN: µFSM – A state chart library for embedded applications

github.com

1–10 of 35 posts

Re: Show HN: µFSM – A state chart library for embedded applications

#5
post #2

Probably worth having a look at this: https://youtu.be/c9Xt6Me3mJ4?t=4196 Embedded shouldn't rhyme with "C".

It's true that embedded software doesn't need to be written in C but if you're distributing a _library_ that's aimed at embedded systems then C is still a terrific choice for a ton of reasons. The goal of a library should be to embrace the path of least resistance for adoption. And when you're working in the embedded space that means targeting the least common denominator. Are all embedded systems extremely resource constrained? No, but many are. Do all applications running on embedded platforms need to be real-time? No, but many do.

Writing in C means you can get small binaries, with minimal runtimes, easy control over things like memory allocation, and if you want to use the library you don't have to write C because almost any language with any form of FFI is going to target C before it targets C++.

Re: Show HN: µFSM – A state chart library for embedded applications

#9
Very nice! Anything that allows something more sophisticated than switch:case in embedded systems are welcome! Also, state machines are way too often overlooked as a proper model for embedded systems architecture. My guess is that proper implementation may become hard (specially if you want to nest them), and there are lots of hardware engineers doing firmware.

In my case, when I want to use a state machine for a project, I usually go with Quantum Leaps [1] tools. Nowadays their website seems cluttered and management-focused, but the tech is solid and the tools are very robust.

They also distribute a book [2] on how to use the model using their framework as an example, and I even implemented my version of it as an exercise years ago.

It does not have (or did not, I haven't checked in the last few years) a tool to translate from XMI to their framework, but they have a freeware to draw the chart. Frankly, I have not even used it: I draw the state machine using some editor and it is easy enough to translate to code and maintain. Maybe not the best, but up until now, very nice to deal with the limited complexity of most embedded systems.

[1] https://www.state-machine.com/doc/concepts#HSM [2] https://www.state-machine.com/psicc2/

Post reply on HN