David Trussel

C++ / Python / Embedded Linux


My personal blog Project maintained by dtrussel
  • Yocto: How to add packages to the SDK?

    Yocto: How to add packages to the SDK?

    Normally a Yocto SDK includes all dependencies that are needed to build everything on your target image. But how can you add something to your SDK specifically? That might be useful if you want to build software components that are not included in your final image or you might want to provide developers with some development tools.

  • Yocto: Recipe flavors

    Yocto: Recipe flavors

    If you have done some Yocto development you might already have encounter them in the wild… native and nativesdk recipes… Recipes cannot only be built for the target, but also for your build host or your SDK host. This post gives a short summary about what the different recipe “flavors” are used for and how to add them to your recipes.

  • C++ Design Patterns: Low effort observers

    C++ Design Patterns: Low effort observers

    Another classic Gang of Four Pattern is the Observer Pattern. In this pattern, observers want to be notified about state changes of a subject. In this post we will look how to easily implement this with std::function.

  • C++ Design Patterns: A Modern Command Pattern

    C++ Design Patterns: A Modern Command Pattern

    Don’t worry. This is not yet another take on the classic Gang of Four Command Pattern. Instead we look at how we can use modern C++ features to solve the same problem in a different way. Namely we want to send commands to a (possibly) remote application, whilst choosing a testable and maintainable design.

  • C++ Design Patterns: Template Method - no templates involved

    C++ Design Patterns: Template Method - no templates involved

    Assume you have something that has an overall structure, but some parts of it need to be customized depending on the use case. The idea of the Template Method pattern is to define the overall structure in a base class and let the derived classes override the specific behavior.

  • Back to basics: C++ Inheritance in a nutshell

    Back to basics: C++ Inheritance in a nutshell

    C++ is an object-oriented language and inheritance can be used to define relationships between objects in the form of class hierarchies. It provides a mean to structure and organize your code. Assuming that you already know the basics of inheritance, we will look at how and when to best use it. Especially we look at how to use it for runtime and compile time polymorphism.

  • C++ Design Patterns: Singleton - the Classic

    C++ Design Patterns: Singleton - the Classic

    The singleton is one of the simplest object-oriented C++ patterns. Probably due to its simplicity, it is also an often misused one. It is easy to implement your own, and therefore one might tend to use it a bit too often as a design choice. When should you use a singleton then? The answer is quite obvious, when you need a unique global object. However remember, global variables are usually frowned upon and you shouldn’t treat a singleton any other way. Avoid global variables as much as you can, but in some cases they are valid design decisions.

  • Yocto: Switch to systemd

    Yocto: Switch to systemd

    Yocto’s reference distribution poky comes with SysVinit as an initalization manager. However many major linux distributions use systemd as a system and service manager. In this post we will look how to easily switch your yocto distro to systemd.

  • Back to basics: How to organize your C/C++ project

    Back to basics: How to organize your C/C++ project

    Back to basics. When I started C++ programming I had a hard time figuring out how to organize my projects. Most text books or lectures were more focused on teaching either programming principles or language features. So in this post I would like to share what is in my opinion the best project structure.

  • Yocto: Build your own linux distribution

    Yocto: Build your own linux distribution

    In this post we are going to create our own yocto layer. The Yocto Project is an open source project that lets you create your own embedded linux distribution. You create recipes that are bundled into layers (which are usually called meta-something). The recipes consist themselves of tasks (do_compile, do_install…) and let you specify dependencies between tasks. These recipes are then baked into an image with yocto’s build system called bitbake. The generated outputs of a recipe are called packages (one recipe can provide several packages).