
Should you design your hardware product around a microcontroller or an embedded Linux system. Below, I’ll offer some common elements I always look at when choosing between the two paths.
Functionality
Is this a problem that can be easily solved with a microcontroller? Is it simple enough and well defined enough that we can say our chosen microcontroller has sufficient processing power, peripherals, memory, and manufacturer provided software support to reasonable achieve our goals.
If yes, then a microcontroller may well be a good option, but there are other elements to consider as well. If the problem is complex enough that you find yourself having to engineer complex systems with a bunch of peripheral ICs or having to use extremely high power microcontrollers to write multi-threaded applications, a Linux system will likely be much simpler to work with and provide a much faster time to market. Similarly, if you don’t really know the limits of your problem space and may need to rapidly change your hardware, the agility provided by an embedded Linux system is a much better fit.
Another piece of functionality that may play a role is if the system is a true real-time system, where you need sub millisecond accuracy on the timing of certain events and instructions. The vast majority of project are not this, but it does come up from time to time, especially in defense, automation, or automotive spaces.
Power
This mostly comes down to a simple calculation, is this device plugged into a wall or is it battery powered. If it is battery powered, how large is the battery and how long do you need it to last? With microcontrollers, you can achieve orders of magnitude lower power draws, due to their ability to go into a low power sleep mode, something an embedded linux system cannot do. This can normally be figured out in a few minutes with a spreadsheet.
Cost
This is probably the simplest and yet most important element to the decision. A cheap embedded Linux module will start somewhere around $30 dollars and they can run up to the $1000s of dollars for high power, specialized modules. Low cost micro controllers can be had for a few dollars or less, though specialized ones can be much more expensive. If you product won’t have sufficient margin to support and embedded Linux system, then you hands are more or less tied.
Conclusion
Generally, after reviewing the above elements, one path becomes clear. If I am ever on the fence, I almost always choose embedded Linux. It provides so much more flexibility, you aren’t tied to once manufacturers flavor of embedded c and can use languages that provide much more developer productivity and community support. Once the problem space has been much more refined, I find it a lot easier to move elements down into embedded C rather than trying to keep an embedded C code base clean and testable while the requirements are in flux.