Embedded Software Development is Hard. Avoid These Mistakes

Embedded Software Development is Hard. Avoid These Mistakes

By Jeff Tranter

The market for embedded software development is one of the fastest growing areas of computing. But as the market grows, so too does the complexity of the devices. At a time when manufacturers are demanding more sophisticated "iPhone like" user interfaces and greater product functionality, today’s embedded devices often sport graphical user interfaces running on touchscreens and full operating systems based on Linux, and are developed in high-level languages like C++.

It’s an exciting time for developers. But for Qt developers making the transition from desktop or mobile to embedded, there are a host of challenges to overcome. Sure, the toolkit is the same. But those just getting started in embedded development find they need to learn GUI development. And they need to learn the entire Qt framework.

If you’re making the switch to embedded, you’ll likely face other challenges as well, including:

  • Learning how to design systems that are larger, more complex, and often distributed
  • Dealing with limited resources, such as no GPU
  • Learning how to work closely with user experience (UX) design teams
  • Building or configuring your own OS
  • Learning how to use cross-development tools/SDK

Embedded is More Challenging Than You Might Expect

So why is embedded development so difficult? I’ll explain. But first, let me explain what I mean by “embedded system.” Sometimes it is a blurry line.

The vast majority — 98% percent — of the microprocessors manufactured each year are used in embedded systems. For instance, the average passenger car today has between 25 and 50 CPUs, and as many as 70 CAN bus devices networked together. While embedded systems are used in myriad industries, including consumer, industrial, medical, and avionics, sometimes the dividing line between what is embedded and what is desktop is unclear.

For example, is an air traffic control system with multiple large screens, a mouse and a keyboard considered a desktop or an embedded system? Could go either way.

From my perspective, embedded systems typically have these characteristics:

  • They are specialized, single-purpose devices
  • High reliability is a requirement
  • They may have real-time constraints

Embedded systems demand high reliability and up-times — such as in the case with medical devices (which bring additional unique challenges, especially in the areas of testing, documentation, and development process) — as compared to desktop or mobile.

Also for embedded systems testing is particularly important and may even be mandated for regulated devices. Products may need to be supported for years, or even decades, and updates can be expensive to make.

As if that’s not already a lot for new-to-embedded Qt developers to absorb, embedded development has only grown more complicated as technology evolves. There’s a blurred distinction between microcontrollers and microprocessors. Some “crossover” microcontrollers can run Linux and Qt. Popular iPhone-like interfaces that require little, if any, operator training and skill, make UX design an increasingly important aspect of software development.

Add compressed time-to-market schedules and shorter product life cycles, and the pressure on developers to deliver code quickly is palpable.

Changing Face of Embedded Development

A decade or two ago, elements of embedded development included:

  • Microcontrollers
  • Assembly language or C
  • OS: bare metal or simple scheduler
  • User interface: lights, switches, text LCD
  • Standalone devices
  • Homegrown software
  • Code in ROM

Today, things look very different as reduced hardware costs now mean embedded systems typically have capabilities equal to or greater than that of a high-end PC from just a few years ago.

  • Multi-core microprocessors (SoC, SoM) with FPU, GPU
  • C, C++, Java
  • Full operating system with filesystem, networking, etc.
  • Touchscreen UI
  • Connectivity with other devices (WiFi, Bluetooth, CAN bus, Modbus, IoT, cloud, etc.)
  • Third-party software (e.g. Qt)
  • Regular software updates (features, cybersecurity)

The Secret to Success

How can Qt developers new to the embedded space succeed? Let me offer four pieces of advice gleaned from years in the field.

1. Leverage existing software. Don’t reinvent the wheel.

2. Do what you can to avoid making these common mistakes:

  • Locking down hardware before any code has been written
  • Assuming UX design will be done once and never change
  • Not doing formal UX design
  • Developing on desktop and then porting to embedded
  • Underestimating effort for testing
  • Not enough communication between teams doing application, OS, hardware

3. Don't underestimate the effort necessary to set up your development tools and a stable OS with BSP.

4. Always follow best practices, including:

  • Use source code control (usually some form of git plus web UI)
  • Continuous integration with automated builds
  • Follow test-driven development (or at least unit tests)
  • Measure test coverage
  • Code reviews

The Takeaway

As the development of new technology accelerates, switching from desktop or mobile to Qt-powered embedded development offers great opportunity — but also many challenges. You can ease the transition by following some simple advice and closely adhering to best practices. 

For more on this topic, listen to our on-demand webinar, Understanding the Complexities of Embedded Development.