If you’re starting out in your software development career, or wanting to switch to a development role, you might be wondering where to start. When it comes to embedded software development, depending on who you listen to, you may get differing advice on what to learn.
With that in mind, this blog post makes some programming language recommendations for those just starting out in embedded software programming. We also make some suggestions on how to move those embedded software skills over onto working with actual embedded hardware.
The recommendations here are merely suggestions, but we think they’ll help you out if you are completely new to software programming and embedded software.
Disclaimer: The inclusion of pictures of pets in this post is not an indication that you need a pet to work at Bluefruit or to learn how to code. It’s just an excuse for this blog post’s writer to include images of pets to break up from the repeated imagery of “classic” tech images.
Where were we? Oh, right…
What is embedded software?
Now, you might be wondering: what’s embedded software? Embedded software is the software that controls embedded systems. Embedded systems are very small computers you find within products like washing machines, or cars or helicopters (both of which have LOTS), or your boiler, or a blood sugar levels monitor. When we say small, we mean they are often using tiny amounts of memory and processing power versus the device you’re reading this blog post on. These embedded computer systems have a singular purpose, unlike a personal computer (PC).
Microcontrollers form a key hardware element of embedded systems, providing the ability for these systems to operate in (relatively) real-time conditions. You may have heard of microprocessors before, variants of these are found in regular personal computers (think CPU (Central Processing Unit) or GPU (Graphics Processing Unit)), but a microcontroller is essentially a type of microprocessor that has some structural differences to what you’ll find inside a PC. These differences include integrated memory and peripheral interfaces.
Our founder, Paul Massey explains embedded systems and software like this:
Essential embedded software languages
The following are the main languages we would consider for microcontroller programming.
(NOTE: In the case of C and C++, we expect all our software engineers to be skilled in one or both.)
Bare metal languages
C++ is much preferred over C, as it is a richer, more expressive language. Modern compiler features like classes and generics make coding less monotonous, faster to complete and yet do not sacrifice speed.
C was once the kingpin of embedded software development, and C is still widely used, but it probably shouldn’t be chosen unless you have no other option! Some microcontrollers, such as tiny 8 bit PICs, still have no C++ compiler.
Assembly is not so useful these days, as you will usually achieve better performance from equivalent code written in C, C++ or Rust. You do need skill with Assembly to implement some features of Operating Systems, however, such as a context switch. It is also useful for debugging tougher problems via disassembly.
(Learning Assembly isn’t essential to joining our software teams, and it’s the kind of thing you’ll learn as you go when you join our team.)
And a new addition…
Rust is a relative newcomer that is fast gaining traction in the embedded software world. Rust allows you to better constrain the effects of your code using built-in language features, making it possible to provide extra safety. At Bluefruit Software, we are currently using Rust in a R&D project in which we’re building a secure bootloader using Rust, and we’ve implemented elements of Rust in one client project so far.
A note on bare metal
Bare-metal programming means writing code that doesn’t need an operating system to run. It works directly with the hardware of the system. The languages above can work without an operating system (and in the case of Assembly is just one level above binary). You’ll also find them used with other embedded environments like those using a real-time operating system (RTOS) or an embedded operating system like Embedded Linux.
A note on Embedded Linux
Embedded Linux is not a coding language, it’s a family of operating systems (OS) designed for embedded devices that need an OS. It runs on full blown processors like the Cortex A series, and flavours of it can be found on things like the Raspberry Pi. Working as an embedded software engineer, it’s helpful to be familiar with it as projects will often require it.
Projects that often make use of Embedded Linux include:
- Internet of Things (IoT) devices.
- Systems that make use of Graphic User Interfaces (GUI), including things like touch screen devices that aren’t smartphones or tablets.
- Voice controlled systems that have natural language processing will often use an embedded OS like Embedded Linux.
A project that uses an Embedded Linux distribution basically has a slimmed down version of a Linux OS, with only the functionality the system needs to work as intended.
Other handy programming languages to know
The following have various uses, though are less involved in making embedded systems work.
Python, with its veritable arsenal of libraries available, makes light work of development tasks that would otherwise take a lot longer. It is less suitable for low-level coding, and to work it requires an operating system that can run its interpreter. Our edge AI R&D project, ACE, started off in Python before being converted to C and C++. If you want to work on AI based projects, Python is essential, as much of the AI ecosystem is in Python.
(We also use a Python based framework called Behave to help with automated software testing.)
Ruby is another substantial player, and an excellent scripting language, targeting similar uses as Python though not as widely used in the AI space.
C# (C Sharp)
C# was originally only available on Windows-based systems (as it relies on .NET). These days, through the magic of Mono and Microsoft’s own .NET Core, you can find C# code running on Linux, iOS and Android as well. C# is a very rich language, benefiting from features like “reflection” which go way beyond C++’s RTTI functionality.
VHDL and Verilog
VHDL and Verilog are two excellent “hardware design” languages which allow you to express signals and how they should interact. Code written in either is “synthesised” onto FPGAs to have them behave in the way expressed—the layout of the circuits themselves are programmable.
Where and how to learn embedded software programming
There are many ways you can learn about embedded software development, including going on a formal course or degree, but it’s possible to learn much outside of a formal education setting. And it’s worth noting that many of our developers were self-taught before they joined us.
NOTE: the following recommendations are not endorsements, except for cyber-dojo.
If you’re starting from scratch, try a site like Codecademy
It’s worth seeing what free courses are available on Codecademy. For instance, they have C++, Python and Ruby. They also have courses arranged around subjects like computer science and code foundations.
Other resources you might want to consider include:
- C++ over at com
- A reference site like this C++ one on com
- Google for Education’s C++ class
- Book: The C++ Programming Language (4th Edition) by Bjarne Stroustrup
- The C tutorials on Learn-C.org
- A reference site like the C one on com
- Book: The C Programming Language (2nd Edition) by Brian Kernighan and Dennis Ritchie
Embedded, computing and coding in general
If you want to learn more about computer science as a whole and coding in C and Python, taking Harvard’s CS50x course for free is an option.
There is also Embedded.fm’s Embedded Software Engineering 101 which examines embedded systems and software and has examples. It also looks at Assembly.
And our very own Ed Hazeldine co-hosts the podcast A Question of Code, which looks at questions that newbie coders might have when they start learning to code.
Practice coding on cyber-dojo
Once you’ve got some beginner coding skills, it’s worth practicing them on cyber-dojo. We use cyber-dojo activities to help us test the coding skills of people applying for engineer jobs at Bluefruit Software, we also use it to help train our software teams. And several of our team members have helped create exercises on it.
On cyber-dojo, not only do you go through coding exercises, you also have to complete them using Test-Driven Development (TDD) practices. All code we write at Bluefruit is done using TDD, so it’s good to learn how to programme using TDD practices.
Decide on a project you want to do
Learning about embedded software development is, ultimately, best done with access to hardware.
But don’t just rush out and buy something, think of a project first once you’re feeling comfortable with some programming basics.
Is there a problem you want to solve? Or something you always wondered if it’s possible to automate in some way? Have you wanted a simple electronic device and wondered how you could make it yourself?
Pick your project and then research it, from hardware through to software.
Arduinos are a good beginner microcontroller board
An Arduino is often a good place to start for exploration and there are readily available projects. The Arduino Project Hub (which can be arranged by difficulty) has good projects, though you might want to check out the Tutorials homepage first.
You’ll still need a separate system, a development environment, to write the code for the Arduino. The system you develop on could be a standard PC or even a single board computer like a Raspberry Pi 4.
It’s also worth starting to learn about schematics as they’re also a key part of developing for embedded systems. The book Arduino for Dummies does have sections exploring schematics and electrical safety.
A few more pieces of equipment you’ll need
You need more than just a microcontroller and a PC to develop your first embedded projects. You’ll also need things like:
- A digital multimeter (DMM)
- A surge protected power outlet (a gang)
- Jumper wires
- Electrical tape
Much of this will depend on your project requirements, and they’ll likely list further bits you’ll need to do a project.
A note on soldering: don’t attempt it unless you’ve read up on clear safety guidance and how-tos, plus have the right personal protective equipment (PPE). RS Components (and this is not an endorsement) have a beginner’s guide to soldering on their site.
Once you’ve built up your skills on something like an Arduino, you’ll want to graduate to a microcontroller board that is used in actual embedded devices.
You could invest in a STM32 Discovery Kit. A lot of our client projects are developed for STM32 microcontrollers.
Alternatively, the Curiosity Development Boards from Microchip are a possibility. We’ve also worked on Microchip microcontrollers for client projects.
We hope this post has given you some ideas about how to start your embedded programming journey.
(Again, pet ownership is not a pre-requisite to working at Bluefruit.)
And if you’d like to know when we’re recruiting for software development roles, sign up to our recruiting mailing list (below). Our careers page lists current open roles.
Bluefruit Software job mailing list
Did you know that we have a monthly newsletter?
If you’d like insights into software development, Lean-Agile practices, advances in technology and more to your inbox once a month—sign up today!Find out more