Some Embedded System Software Design Resources
I recently received a message from an embedded systems engineer in England asking about a good resource for embedded system software design and easing debugging difficulties.
That's challenging because embedded systems cover such a wide range. There are many possible run-time environments and architectures.
Thus there's no single resource that covers all ground. However, the resources below provide a lot of good material. In aggregate, they make up a good set from which to pull various concepts and techniques.
This may look like a lot of reading. Invest one day where you spend an hour or two on each one reading the first sentence of each paragraph to skim the content. Then decide which parts to read fully to meet your needs. In addition, plan to spend some time hands-on trying out what they cover.
Embedded System-Specific Design
These provide a number of practical strategies for approaching embedded system design:
- https://amzn.to/3YcDfhg Making Embedded Systems: Design Patterns for Great Software, 2nd Edition, by Elecia White.
- https://amzn.to/4cERtvz Embedded Software Design: A Practical Approach to Architecture, Processes, and Coding Techniques, by Jacob Beningo.
- https://amzn.to/4feh1RK Reusable Firmware Development: A Practical Approach to APIs, HALs and Drivers, by Jacob Beningo.
Generic System Design
This is my favorite of Bob Martin's "clean code" series, applicable to any kind of system.
- https://amzn.to/3LuGiK3 Clean Architecture: A Craftsman's Guide to Software Structure and Design by Robert Martin.
Test-Driven Development
You should absolutely be using TDD (specifically, BDD-style TDD) and off-target testing for your embedded code. Yeah, it has the word test in it, but it's really a design methodology and enabler.
That means you need to structure things to segregate platform-specific code from platform-independent code. That is, the code that depends on specific MCU register sets, vendor libraries, and specific RTOS; vs. the code that could run on any MCU, under any OS. Much of the logic in any embedded system is platform-independent, generic; then it needs to interact with the platform-specific elements.
The reason for doing this is that it will significantly cut down or even eliminate the need for debugging while enabling good design. By testing and shaking out as much code as possible off-target, you'll be running it as known-good code on-target, i.e. on the embedded target. Meanwhile, the discipline and process of applying BDD drives testability and design.
My Embedded Online Conference presentation Example BDD Style TDD For Embedded Systems Software gives a simple but practical example of this, based on my blog post Bit-Banged Async Serial Output And Disciplined Engineering.
This is the book that started me using TDD for embedded systems, which I highly recommend, it's a real game-changer:
- https://amzn.to/4bXbWKJ Test Driven Development for Embedded C, by James W. Grenning.
You can read my review of it at Review: Test Driven Development for Embedded C, James W. Grenning, as well as my review of his online course (2018 version) at Review: Web-Based Course Test-Driven Development For Embedded C/C++, James W. Grenning.
- Comments
- Write a Comment Select to add a comment
To post reply to a comment, click on the 'reply' button attached to each comment. To post a new comment (not a reply to a comment) check out the 'Write a Comment' tab at the top of the comments.
Please login (on the right) if you already have an account on this platform.
Otherwise, please use this form to register (free) an join one of the largest online community for Electrical/Embedded/DSP/FPGA/ML engineers: