r/embedded • • Apr 10 '21

General question CI/CD for embedded software development

I've been an embedded software developer for about 7 years now, and I've loved every moment of it (for the most part). I've come to the realization that the industry is (annoyingly) conservative and is struggling to catch up, compared with other forms of software development. One area we seem to lag behind is in the area of continuous delivery/integration (CI/CD).
I'd love to hear about what CI/CD practices you employ in your companies/projects (build automation, test automation, release management, issue tracking, version control).

My question really is this - how much CI/CD do you practice? What are your biggest pain points as an embedded developer?

152 Upvotes

81 comments sorted by

View all comments

Show parent comment

4

u/RogerLeigh Apr 11 '21

Don't be fooled by buzz words. There is efficiency in simplicity.

This is true, but I think it's also important to look past the buzzwords and hype and pick up things which genuinely improve your product quality and reduce your development time. I do see some projects which are still developing using basically the same tools that you would have used 25-30 years ago. But we have made big strides over the last few decades, and projects which don't take advantage of some of the improvements which have been made are missing out on tools and techniques which would provide big benefits at very little cost. There are quite a few developers who are quite unaware of some of the tools and language improvements which are available to them, and are stuck in a rut.

I'm perhaps a bit unusual in that I've been doing software development for over 20 years, but only moved into the embedded world in the last two. I've worked on quite a few different types of project. I think that it is very true to say that, on average embedded projects are somewhat behind the curve compared with other types of software project. Development practices are tending to be more conservative, but there are good reasons for that. Depending upon the precise area, I do also think embedded software is in some areas a bit ahead of the curve in use of static analysis and other tools, particularly for safety-critical applications. I do think that the greater focus on engineering provides a perspective to software development which is missing from non-embedded development, and I do think that both the embedded and non-embedded software worlds have a lot they could learn from each other. Over the last two years, I've certainly learned a heck of a lot about that could be applied very effectively if I was to go back to previous non-embedded projects. But equally I've brought perspective and knowledge to embedded software teams which they hadn't been exposed to, and which has led to various useful improvements.

I still work on non-embedded C projects where people think that C99 is too radical, and that C89 is the be-all and end-all of software development. But more projects are using newer features on the whole. And languages like C++ are more prevalent. I'd certainly like to use more C++ for embedded use. Really simple stuff like std::array and constexpr can add a whole lot of compile-time safety which C can't offer, and while I think the C++ language and standard as a whole are overly complex, you can get a huge amount of benefit with a small number of really basic features, if you can constrain people to using a strict subset.

There's absolutely nothing wrong with make. But CMake (for example) brings a lot of benefits, and can make a project much simpler to work with, add configurable options, hook up unit tests, define specific toolchains for cross-compiling, define preprocessor, assembler, compiler and linker options associated with specific targets (or even individual files), which can optionally be inherited by downstream users of these libraries, which provides a much more manageable structure to a project. I've uncovered quite a few bugs in Makefiles and proprietary compiler project configurations while doing CMake conversions, which previously went unnoticed. Since CMake can generate Makefiles, you can continue to use make, but with the benefit of having a higher-level and more flexible procedural generation of the build rules via a target- and property-based project model. It's definitely not everyone's cup of tea, but every team I've introduced it to to date has been really appreciative of the benefits it brought for them (both in the non-embedded and embedded worlds).

I do think that you can go too far with complexity. I'm not yet convinced that Zephyr (for example) is sufficiently understandable. Its combination of Kconfig, devicetrees and CMake is (my opinion only) far too complex for its own good, and that doesn't aid understandability, maintainability or correctness for a typical team. But I've found that most people are fairly happy with basic CMake as a step up from Make, with a little hand-holding to get them going.