I am a firmware engineer moved from Electrical background to Embedded Systems. I was till now programming in C and never bothered to apply OO principles in my design. Recently I was forced to implement design in C++. I started liking the OO principles like SOLID, design patterns, etc. I wanted to know more about applying OO design in my firmware design. All the resources on OO, that I found were too much into application programming rather than firmware. I found this book relevant (ordered it). I was curious if there are any other resource that can help me learn OO principles with a focus on embedded systems.

I am still new to OO world, so please suggest me if I should learn OO principles first and then learn about applying them for embedded systems or start learning only stuff relevant to embedded system.

  • 1
    There is a lot of stuff going on in this question. Moving from EE to firmware programming, moving from C to C++, doing OO in C++, design patterns using OO, etc. Just stop, take a deep breath, and learn to eat the elephant one bite at a time. Become proficient in C++, understand that C++ is a lot more than OO, that Design Patterns aren't the be-all end-all, and that at the "application level", a lot of firmware development is similar to non-embedded development. Separate the application logic from the hardware access to begin with...
    – Radian
    Commented Oct 21, 2011 at 15:59
  • @Dan Thats my problem exactly!! Too many variables and not able to get a grip on anything. Thats why wanted to know where to start? I could put some code together and get the functionality out, but if i try to find what is the best way to do it, its taking long time and missing my deadlines. Is their any standard order to go about this transition? I am sure lot of people have already travelled this path. which one to focus first?
    – phcd
    Commented Oct 21, 2011 at 16:21
  • This isn't what you asked about, but Agile development practices are also probably unfamiliar to your Electrical background. See this blog (and its links to some other sites here) for some info on how to do agile development in embedded systems. Commented Oct 21, 2011 at 16:26
  • 1
    @phcd - you are on the right track and I definitely encourage you to keep going. "...if I try to find what is the best way..." -- most likely you will never find it. I've been doing C++/OOD professionally for 12+ years and it seems I still discover better techniques/methods I haven't thought of before. Instead, do your work and focus on getting it done AND finding a BETTER way. A lot of times you will discover this after the project is done, but that's ok. Learn what you can and move on.
    – DXM
    Commented Oct 21, 2011 at 16:45
  • 2
    See also Is C++ suitable for embedded systems? on Electrical Engineering Commented Oct 25, 2011 at 12:37

2 Answers 2


About 8 years ago I was faced with a similar issue. I had just started a role working with embedded technology, having previously spent several years doing object orientated programming in C++.

I was never particularly successful in bringing application techniques to device driver code. I did manage to write some useful classes for abstracting away I/O bus widths, processor bits size and bus driver implementations, but the reality was that it made life much more confusing for the other members on the team.

Think of it like this: most embedded software engineers have been in the industry for a good many years. They are used to dealing directly with bits, bytes, and manipulating memory, and that's the focus of their work. Getting the right bits to the right memory address. My attempts at using OO to abstract away these details just hid the key details. It made it harder for the hardware engineers to see what was happening, and the other C programmers didn't see any benefits over "just being obvious"

By the sounds of it, in your environment, you are being actively pushed in the C++ direction. so its quite possible that you will not have these issues, but also watch out for the drop in the portability of the C++ code. not all low level environments will allow C++ code to use used, and the "Standard Template Library"'s use of the word Standard is rather loose, particularly when moving between different compilers.


In his course Effective C++ in an Embedded Environment, Scott Meyers states:

Good embedded software development is just good software development.

So if you get a good solid grounding in object oriented techniques in general, you can apply them in the embedded environment.

That being said, Meyers presents how

  • Software must respect the constraints of the problem and the platform.
  • C++ language features must be applied judiciously.

Meyers makes his course notes available in PDF format for a small fee at his course page.

Not the answer you're looking for? Browse other questions tagged or ask your own question.