Close

Diving into CMake and Docker (and a few other tools)

A project log for Data Logger Shield

Shield for NUCLEO-F103RB that logs pulse data from up to four devices. Includes WiFi, microSD storage, LCD with buttons, and USB UART.

robert-gawronRobert Gawron 09/29/2024 at 18:480 Comments

Last week, I was working on cleaning up the CMake files and setting up Docker. It was quite difficult because I don't know either of them well, but in the end, it works pretty well.

Personally, I really like the idea of Docker because, in a file, you can configure your environment and - here’s where the magic is - this file is treated as configuration/code. Meaning, it’s parsed and checked by a machine. It’s not a README that’s never up to date, but something that gets “compiled,” and you get errors if something is wrong. Some DevOps guys would probably laugh at this description, but it’s true :)

I’ve also experimented a bit with hpp2plantuml, a tool to generate UML class diagrams based on existing code. I wasn’t happy with the results as it omitted a lot of connections that exist in the code, but the setup is easy, and what it generates is accurate (it’s just not complete). I even have a build for that!

Another tool I checked out is include-what-you-use. Setting it up isn’t trivial, at least on Linux, as it needs to be downloaded and compiled manually - the old-school way. It also requires, AFAIK, Clang as a compiler, meaning you need to have a build version using Clang. I haven’t yet paid much attention to what it generated, so I can’t say if it’s useful for embedded projects. BTW, it was developed at Google.

I also removed the build for Valgrind because I intentionally don't use either the standard library or dynamic allocation, so it was kind of silly to include that tool.

Discussions