Skip to content
0:00 / 0:00

#constexpr#cib#crtp

emBO++ 2022 The constexpr init()/build() pattern: compose modular firmware with minimal runtime cost

Open Skunkforce e.V.

1.1K subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.

Advanced. Deep dive for people who know the field.

6K views4 years ago2 recommendations

Systems programmingProgramming languagesEmbedded systemsC++Performance and optimization

This talk explains how to use the constexpr init and build pattern to compose modular firmware with zero runtime cost.

Reusable firmware components enable quick project turn around time with high quality output. Attaining clean composition of components while meeting runtime and memory usage requirements can be a difficult problem to solve. Making a service extendable traditionally requires additional runtime and memory. Additional runtime is required for features to register their extensions with extension points. Additional memory is required to store all of the extensions in each extension point. The constexpr init()/build() pattern minimizes the runtime cost of clean composition by moving the entire initialization of extensions into a compile-time computation. Initialization time is eliminated from runtime. Memory usage can be optimally allocated at compile time. This pattern has significant implications for organizing interrupt handlers, composing sequential flows of operations, callbacks, event listeners, and message handlers. Luke Valenty started his career at Intel in 2008 developing simulation tools for validating hardware designs. He has been a firmware engineer writing C and C++ since 2018. Most recently Luke has led firmware development activities moving to C++ from C. Luke enjoys analyzing problems down to their fundamental concepts and developing solutions using state of the art techniques and methodologies. This talk is part of the embedded systems conference emBO++

Why it's here

2 people recommend this

What people say. Recommended as an excellent resource on moving embedded initialization to compile time using modern C++.

Moments people linked to

u/MSaeedYasinin r/embedded • Recommends

…sm. *This seems to be the general trend in embedded systems, moving as many things as possible from runtime to compile time to achieve smaller and more efficient code*. One library (called cib) which uses CRTP and constexpr to generate a simple framework to use is https://github.com/intel/compile-time-init-build Here is a detailed video about it link to this video My question is this, how do SOOP approach and CRTP approach compare? Are my conclusions sound or is there an even better coding architecture appoach? If someone has more information about these concepts or thoughts about future of embedded programming, please do share.…

u/bear24rwin r/embedded • Recommends

On “How do you handle data coupling between RTOS tasks?”

Check out this talk link to this video

u/pinazeirain r/embedded • Mentions

On “Looking for well written, modern C++ (17/20) example projects for microcontrollers”

Have a look in the modm. init/build is supposed to be the new thing, but i never touched and no embedded example are available. link to this video
1View on Reddit