The evolution of embedded devices: Addressing complex design challenges
Embedded devices used to be relatively straightforward to design before the Internet of Things. The designer of an appliance, industrial controller or environmental sensor only needed to interface the input signals, process with a microcontroller and provide output control. Systems were standalone; and other than reverse engineering, there was no incentive for a hacker to access a system.
With the introduction of the smartphone, we now expect our devices to be smart, upgradable and accessible over the Internet. Security is not optional – if security is not taken seriously, data, brand reputation and revenue streams will all be affected. Also, embedded systems are becoming more complex and you can’t be an expert in everything! Fortunately, you can use existing standards and stack libraries to get a project completed in a timely, secure way.
This article outlines the key design challenges an embedded developer faces today, and some of the new technologies that will help designers address these challenges.
Key design challenges and market expectations
- Rich user interfaces
The first smartphones introduced a rich user interface with a high-quality display and touchscreen. High-end embedded devices have added LCD and OLED displays and touchscreens. This has increased the processing requirements and the need for an application processor and a rich operating system. For those that do not need an application processor, technology advances have pushed clock speeds for microcontrollers from tens of megahertz to several hundred megahertz, and memory sizes to several megabytes. This has allowed designers to continue benefitting from familiar architectures, such as that used for Arm Cortex-M.
Many embedded systems only need a user interface for configuration and occasional control. Consumer and industrial IoT devices are price-sensitive and benefit from the internet connection to allow control via a web interface or smartphone app. As an example, data from industrial sensors can be monitored remotely to manage performance and errors, as well as pre-empt potential failures. This presents new challenges for the embedded engineer. They now have to know about RF, protocol stacks, security, remote management and firmware updates.
Figure 1: Smart home controls (Source: Getty Images, ID 908590688, Elena Pejchinova)
- Local and remote control
You can implement local and remote control via Ethernet, WiFi, Bluetooth, Z-Wave, Zigbee or Thread – each has benefits when it comes to power consumption, complexity and cost. In general, low-power protocols such as Bluetooth low energy, Z-Wave and Zigbee are good solutions for battery applications. These include door locks, environmental sensors and wireless alarm systems. Devices that need more bandwidth, such as security cameras and sensor gateways, will be connected via WiFi. Or, devices in remote locations will use cellular. An interesting option is to combine WiFi and Bluetooth low energy. Bluetooth is then used for commissioning and local access for low latency, and WiFi is used for remote access via the Internet.
The challenge for the embedded design developer is not only how to choose the right solution for their product, but also the complexity of integrating radio, communication stacks and managing power, all without increasing costs.
Figure 2: Network of a city (Source: Getty Images, ID 811360940, Dong Wenjie)
- Low and lower power
Low power consumption is critical in battery-powered applications. For example, smart water meters need to function on a single battery for the lifetime of the meter, which could be up to 20 years. On the other hand, in a door lock the battery may be replaced once a year and this requires careful design. One of the techniques used for power saving is to design a very low power microcontroller to turn on for very short periods to sense user interaction. It will then sleep for longer periods.
- Devices are becoming smarter
Designers are looking for ways to differentiate their products by adding smart features. Smart features usually imply that a device learns more about the user, the environment and the system, and it can adjust the functionality.
Machine learning is one way to add smart features using an algorithm that can learn and adapt. We see machine learning all around us today: from your fingerprint unlock (matching to a small set of fingerprint images) or the Facebook auto-tagging functionality. However, it is a fairly new solution within embedded, cost-constrained systems.
A great example of machine learning for embedded are smart thermostats. The thermostat will learn the behaviour of the user based on their lifestyle, and then over time, will automatically adjust the temperature to the most comfortable setting. For the industrial market, an example could be a vibration sensor for motors. The sensor can learn the normal vibration signature of the motor and then warn personnel when the unit requires maintenance or is about to fail.
The challenge for embedded designers is getting started with machine learning algorithms and being able to adapt algorithms for the needs of the application.
Figure 3: Smart home climate control system (Source: Getty Images, ID 474200292, MaxiPhoto)
- Products need to be updated
Products today seldom ship with the final feature set. Through over-the-air (OTA) updates, new firmware can be downloaded to add features, fix bugs or patch security holes, significantly extending the product’s useful life. Products also have to be designed with enough headroom in memory and processing power to enable an increase in code size and functionality.
One challenge is to ensure firmware updates and all communications are secure. When a firmware vulnerability is patched, the system should not allow a rollback of the firmware. If it does, the vulnerability will be exposed.
Figure 4: Examples of embedded applications that may require OTA updates (Source: Image from Getty Images, ID 145676156, Earl Wilkerson. Icons: Arm)
New technologies to help designers address these challenges
I’ve outlined the challenges facing embedded designers and the industry trends driving them, but what about the potential solutions? I would argue there are three fundamental design techniques that impact all of the areas defined above: implementing signal processing, securing your device and adding intelligence through machine learning.
How can I simplify signal processing and save cost?
Most embedded systems have analog interfaces. These can be as simple as reading the temperature via an analog-to-digital converter, to more complex systems such as processing sound from multiple microphones (beam forming) and voice recognition.
Older designs used to carry out most of the application and filtering in the analog domain, but with dedicated digital signal processors (DSPs), the processing has moved to the digital domain. This is because DSPs are more accurate, repeatable in manufacturing and can be adjusted over time.
With the introduction of digital signal controllers (DSCs), or microcontrollers with DSP extensions, designers can now have the best of both worlds. A single controller that can perform the DSP and control functions offers a reduction in cost, board space and power consumption.
Digital Signal Processing can be complex, but designers don’t have to be experts to use advanced processing. For example, Arm provides a free software framework for embedded applications, CMSIS-DSP libraries.
Why should I care about security?
A product that ships with inadequate security can lead to the loss of data, embarrassing publicity, financial costs and customer frustration. Security attacks can span all sectors and have varying levels of impact, from gaining access to a home automation system and turning lights on and off, to industrial espionage and gaining access to a network through IoT devices.
External threats can be categorised into four attack types: communication, lifecycle, software and physical. But how do you know which threats you need to guard against and how to design with the right level of security for your device? Last year we launched a security framework for anyone designing connected devices, Platform Security Architecture (PSA). It is a three-stage process giving designers and developers everything they need to determine the level of security and the threat mitigation they should opt for. The PSA documentation and open source code (Trusted Firmware-M) makes it easier for developers to get started.
Figure 5: Arm technology available to mitigate against security vulnerabilities (Source: Arm)
How do I add smart features?
Smart features can be added by implementing complex algorithms written by data scientists. A system that responds to voice commands may be implemented by analyzing sound samples and comparing these to a template for each command. The problem with this approach is that it may work well for one user, but not across a wide range of users, and would not be robust in a noisy or changing environment.
Smart features using machine learning require the system to be trained using a data set such as voice commands spoken by many speakers in different environments and conditions. This training typically uses cloud servers. Once the model is built and optimized, inference, or usage of the model, can be completed on an embedded processor.
One solution is CMSIS-NN, a free neural network library developed to maximise the performance and minimize the memory footprint of neural networks on Cortex-M processor cores.
New era – both new opportunities and new challenges
There is no question that embedded devices are more complex than ever – product requirements are increasing, there is a growing pressure on costs and security concerns continue to rise, especially for connected devices.
These factors all pose significant challenges for developers. But, the good news is that the industry is evolving to support this with IP, software, tools, and training resources to help embedded developers push the boundaries of what’s possible.
Phil Burr is a director for the established portfolio of products within the Embedded Group at Arm. He leads a team responsible for Arm’s CPU portfolio, helping ensure that these processors enable new and existing partners to innovate. Phil also manages the Arm DesignStart program - a low-cost, easy-access route to Arm IP.