Selecting the Right Hardware
It may be surprising that the first chapter of this book, which is written for Cortex-M software developers, is all about hardware. This is because software, in all its forms, is ultimately run on hardware. It is critical to understand which hardware capabilities exist to properly leverage them in software.
Additionally, you will likely need a development board for debugging your code during development. Some of you reading may even have a level of influence over which hardware is ultimately selected for your device. All in all, no matter what specific situation you are in, understanding what Cortex-M hardware is out there—and what it can do—will help you develop quality software for your current and future projects.
So, in this opening chapter, we will explain how to select Cortex-M hardware and provide an overview of where to find development boards. Note that we will be discussing both individual Cortex-M processors and Cortex-M development boards.
There are different ways to frame which Cortex-M hardware is best suited for your specific project. Examples can be helpful; the first section of this chapter lists common embedded/IoT use cases and presents Cortex-M processors that fit that situation. The side-by-side comparison is also helpful; the second section ranks processors by performance, power, and area metrics. The third section then focuses on development boards, discussing trade-offs.
The chapter ends by selecting two boards that will be used for hands-on examples in future chapters. In a nutshell, the topics we’ll discuss in this chapter are presented here:
- Processor selection through use cases
- Processor selection based on performance and power
- Microcontroller development boards
Processor selection through use cases
IoT and machine learning (ML) applications are not only rapidly evolving and changing the way modern businesses operate but also transforming our everyday experiences. As these applications evolve and become more complex, it is essential to make the right hardware choices that meet application requirements. Ultimately, the processor choice comes down to the right balance of functionality, cost, power, and performance. Defining your use case and workload requirements makes determining this balance a lot simpler.
In this section, we will walk through the requirements of some common consumer embedded use cases and determine the Arm Cortex-M processor choices that are ideally suited. The list of use cases and the resulting processor selections are not exhaustive, mainly highlighting that if workload requirements are well understood, the processor decision-making process becomes much easier.
Let’s start with a smart medical wearable use case. The requirements of this wearable include that it will be a wrist-worn device, with long battery life and special sensors to continuously monitor heart activity. Security is a vital requirement as the wearable stores private medical data. Processing power is equally important, operating within the size and power constraints of a battery-operated wearable.
For this case, the Arm Cortex-M33 processor provides an excellent combination of security, processing power, and power consumption. Cortex-M33 includes security features for hardware-enforced isolation, known as TrustZone for Cortex-M. It reduces the potential for attacks by creating isolation between the critical firmware and the rest of the application. The Cortex-M33 has many optional hardware features including a digital signal processing (DSP) extension, memory protection unit (MPU), and a floating-point unit (FPU) for handling compute-intensive operations. The Arm custom instruction and coprocessor interface in the Cortex-M33 provide the customization and extensibility to address processing power demands while still decreasing power consumption.
Note that these hardware features are optional; once manufactured and sold, these features are either present or not. Make sure to check whether the microcontroller or development board you are buying has these Arm Cortex-M processor features enabled if desired.
Industrial flow sensor
Let’s take another use case as an example. Say you’re designing an industrial flow sensor that will be used to measure liquids and gases with great accuracy. It needs to be extremely reliable and have a small form factor. The primary requirement is that it will be low-power and work with this accuracy standalone for very long periods of time. A great central processing unit (CPU) choice for designing such an industrial sensor is the Arm Cortex-M0+, which combines low power consumption and processing-power capabilities. It is the most energy-efficient Cortex-M processor with an extremely small silicon area, making it the perfect fit for such constrained embedded applications.
There are several use cases in the embedded market that require demanding DSP workloads to be executed with maximized efficiency. With the advancements in IoT, there has been an explosion in the number of connected smart devices. There are so many different sensors connected within these devices to collect data for measuring temperature, motion, health, and vision. The sensor data collected is often noisy and requires DSP computation tasks—for example, applying filters to extract the clean data. The Cortex-M4, Cortex-M7, Cortex-M33, and Cortex-M55 processors come with a DSP hardware extension addressing various performance requirements for different signal-processing workloads. They also have an optional FPU that provides high-performance generic code processing in addition to the DSP capabilities. If your workload requires the highest DSP performance, the Cortex-M7 is a great choice. The Cortex-M7 is widely available in microcontrollers and offers high performance due to its six-stage dual-issue instruction pipeline. It is also highly flexible with optional instruction and data caches and tightly coupled memory (TCM), making it easy to select a processor that has been manufactured to meet your specific application needs. Security has become a common requirement for sensors on connected devices to provide protection from physical attacks. If security is an essential requirement for your sensor application in addition to DSP performance, then Cortex-M33 could be a great fit with its TrustZone hardware security features.
With some of the newer sensing and control use cases, we see a common need for not only signal processing but also ML inference on endpoint devices. ML workloads are typically very demanding in terms of computation and memory bandwidth requirements. The significant advancements made in ML via optimization techniques have now made it possible for ML solutions to be deployed on edge devices.
The primary use cases for ML on edge devices today are keyword spotting, speech recognition, object detection, and object recognition. The list of ML use cases is rapidly evolving even as we write this book, with autonomous driving, language translation, and industrial anomaly detection. These use cases can be broadly classified into three categories, as outlined here:
- Vibration and motion: Vibration and motion are used to analyze signals, monitor health, and assist with several industrial applications such as predictive maintenance and anomaly detection. For these applications, the installed sensors (generally accelerometers) are used to gather large amounts of data at various vibration levels. Signal processing is used to preprocess the signal data before any decision-making can be done using ML techniques.
- Voice and sound: Voice applications are in several markets, and we’ve become quite familiar with voice assistants through the deployment of smart speakers. Many other voice-enabled solutions are coming to the mass market. The voice-capture process consists of one or several microphones used for voice keyword detection. Keyword spotting and automatic speech recognition are the primary demanding computing operations of these voice-enabled devices. These tasks require significant DSP and ML computation.
- Vision: Vision applications are used in several areas for recognizing objects, being able to both sort and spot defects, and detecting movement. There is an increasing number of vision-based ML applications ranging from video doorbells and biometrics for face-unlocking to industrial anomaly detection.
Cortex-M processors ranging from the Cortex-M0 to the latest Cortex-M85 can run a broad range of these ML use cases at different performance points. Mapping the different workload performance needs and latency requirements of these use cases to the CPU’s feature capabilities greatly simplifies the process of hardware selection. The following diagram illustrates the range of ML use cases run on the Cortex-M family of processors today:
Figure 1.1 – ML on Cortex-M processors
For example, say you’re designing a smart speaker that is an always-on voice activation device—the Cortex-M55 is a great choice. The Cortex-M55 is a highly capable artificial intelligence (AI) processor in the Cortex-M series of processors. It’s the first in the Arm Cortex-M family of processors to feature the Helium technology, which provides a significant performance uplift for DSP and ML applications on small, embedded devices. Arm Helium technology is also known as the M-Profile Vector Extension (MVE), which adds over 150 new scalar and vector instructions and enables efficient computation of 8-bit, 16-bit, and 32-bit fixed-point data types. Signal processing-intensive applications such as audio processing widely use the 16-bit and 32-bit fixed-point formats. ML algorithms widely use 8-bit fixed-point data types for neural network (NN) computations. The Helium technology makes running ML workloads much faster and more energy-efficient in endpoint devices.
In Figure 1.1, there is also mention of Ethos-U55. This is not a CPU like the other Cortex-M processors but is instead a micro neural processing unit (NPU). It was developed to add significant acceleration to ML workloads while being small enough to be implemented in constrained embedded/IoT environments. When combined with the Cortex-M55, the Ethos-U55 provides a 480x uplift in ML performance compared to Cortex-M-based systems without the Ethos-U55! Keep an eye out for microcontrollers and boards that utilize the Ethos-U55, and learn more about it from a high level here: https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u55.
To summarize this section, one way to select processors is by understanding the use case, clearly defining requirements, ranking them, and identifying project constraints. This is a great place to start the processor selection process.
Next, we will look at using performance and power as metrics to analyze processor selection choices.
Processor selection based on performance and power
Another way to choose and understand Cortex-M processors is by ranking, based on how well they match performance and power requirements. Without structure, this can be a daunting task, with a wide range of possibilities (from the number of interrupts to the overall price, and everything in between). In this section, we will define six categories to evaluate and go over a few examples of how to use this in practice to select the right processor for your project. Again, this is also a helpful framework for understanding what Cortex-M processors’ capabilities are.
We will select the right processor using an approach we will call requirement heuristics. This means translating your key project requirements into predefined areas and following simple steps to get to the right Cortex-M processor. The six areas are listed here:
- DSP performance
- ML performance
In each area, we rank the processors that best meet the project requirement. You can then select the areas that matter most to your project and find the processor that meets these needs. Let’s discuss each area before showing some examples.
When looking at power metrics, there are a few things that will help in understanding technical jargon. There are often two types of power measurements: static (or leakage) power consumption and dynamic power consumption. Static power consumption measures the amount of power used by the processor when not actively processing anything, such as being in a “sleep” mode but with the power still on. Dynamic power consumption measures the power consumed when the processor is actively working on a task. Often, dynamic power is measured using an industry-standard software workload called Dhrystone, to enable consistent comparisons. Power is measured in microwatts (uW)/megahertz (MHz). It is defined as power per MHz to enable consistent comparisons between processors running at different frequencies.
Table 1.1 – Dynamic power across different Cortex-M processors on 40 LP node size
Another factor that affects the power consumption of the core is the technology node size used to manufacture the silicon. This can be referred to as “technology," "process node," or just "node," depending on the context. The node size refers generally to the physical size of the transistors; as the node size decreases, more transistors can be packed onto the same-size silicon wafer. Smaller node sizes also generally lead to reduced power consumption, both static and dynamic. Understanding the node size is helpful for accurately comparing different chips or boards.
Figure 1.2 – Ranking power consumption for Cortex-M
Note that the processors in the preceding screenshot are ordered from best, starting from the top. In this case, the processors requiring lower power for operation are ranked visually higher. We are also not displaying all the Cortex-M processors in this (and subsequent) screenshots—we’re only displaying processors that perform well in the category. The spacing between processors is not intended to communicate precise quantitative differences, only a general ranking based on power consumption. The dotted line is also intended as a qualitative distinction, indicating a notable separation between the processor capabilities on this axis.
The Cortex-M0+ comes in first, as one of the lowest-power 32-bit processors on the market. It can get as low as 4 uW/MHz in dynamic power consumption when manufactured at 40 nm. This processor is being used at the forefront of low-power technologies. It can even be used in applications without a battery, relying on energy harvesting from the environment to power the device. Now that is low power! We talk about energy harvesting and ultra-low-power applications in Chapter 10, Looking Ahead.
The Cortex-M23 is essentially tied with the Cortex-M0+ in terms of minimizing power. It can achieve similar power figures as the Cortex-M0+ when configured minimally. The security features increase power consumption when included. Overall, given how new the Cortex-M23 is and that it is being used more often at lower node sizes such as 28 nm and below, the Cortex-M23 is equally viable for minimizing power consumption.
The Cortex-M0 also minimizes power draw and is only slightly behind the Cortex-M0+ and Cortex-M23. The Cortex-M0+ is typically a better option than the Cortex-M0, being so closely related.
The Cortex-M33, Cortex-M3, and Cortex-M4 all have about triple the power draw as the Cortex-M0+. If the lower-power-consumption processors do not have enough processing power or features for your use case, these processors are likely a good fit.
DSP is needed when taking real-world signals and digitizing them to perform some computations. This is exceedingly common in movement, image, or audio processing applications when data is coming in real time. Devices with sensors and motors to detect and act on real-time data rely heavily on DSP.
The computational nature of these types of DSP applications is really centered on what we call scalar processing. You may be familiar with the word scalar from math or physics classes. A scalar is a quantity that has only one characteristic. For example, measuring gas pressure 10 times a second for 1 second will produce 10 data points. Each point has one characteristic: the magnitude of the gas pressure at that instant. These types of DSP applications, which include audio processing as well, lend themselves well to scalar processing.
To measure how good Cortex-M processors are at scalar processing, there are two common benchmarks: CoreMark and Dhrystone. Using these imperfect but generally helpful benchmarks, you can compare how well different processors run scalar workloads such as the DSP use cases discussed previously. You can download and view the Dhrystone (Dhrystone Million Instructions per Second (DMIPS)/MHz) and CoreMark scores for all Cortex-M series processors here: https://developer.arm.com/documentation/102787/.
Figure 1.3 – Ranking DSP performance for Cortex-M
The benchmark numbers quoted next are valid at the time of this book’s publication. Due to subtle changes in firmware, benchmarks, and compilers, the numbers may change slightly over time. These changes will be small, and the rankings listed are still directionally accurate.
As the newest Arm Cortex-M processor, the Cortex-M85 provides the highest scalar and signal-processing performance to date in the Cortex-M family. It boasts a CoreMark score of 6.28 CoreMark/MHz, is suitable for the most demanding DSP applications, and also includes TrustZone security features.
The Cortex-M7, while being superseded by Cortex-M85, is still a good choice for less demanding DSP applications or where functional safety is critical. The Cortex-M7 has a CoreMark score of 5.29.
The Cortex-M55 and Cortex-M33 are similar in scalar performance, with a CoreMark score of 4.4 and 4.1 respectively.
The Cortex-M4 and Cortex-M3 are the next steps down in performance, with CoreMark scores of 3.54 and 3.44 respectively. The Cortex-M4 is better with DSP use cases due to its optional FPU (which the Cortex-M3 does not have). The Cortex-M4 is commonly used in sensor fusion, motor control, and wearables. The Cortex-M3 is used for more balanced applications with lower area and power requirements.
Applications involving video processing are more demanding than traditional DSP software and benefit from simultaneous processing, called vector processing. Vector processing accelerates the most popular workload today—ML.
Because of its increased popularity and potential in edge devices, we will devote an entire chapter to ML in Chapter 6, Leveraging Machine Learning. In this section, we will give an overview of how ML workloads are executed in hardware to identify the right Cortex-M processor for the job.
ML, at a computational level, is matrix math. NNs are represented by layers of neurons, with each neuron in one layer being connected to each neuron in the next layer. When an input is given (such as a picture of a cat to an image recognition network), it gets separated into distinct features and sent through each layer, one at a time. In practice, this means at each layer, there is x number of inputs going into n number of nodes. This leads to x*n computations at each layer, of which there could be dozens, with potentially hundreds of nodes in each layer.
In scalar computing, this could result in tens of thousands of calculations performed one after the other. In vector computing, you instead store each node’s value in a row (or lane) and make x*n calculations all at once. This is the benefit of vector processing, which has existed in larger Arm cores for years via NEON technology. The Helium extension brings this technology to Cortex-M processors without significantly increasing area and power.
Figure 1.4 – Ranking ML performance for Cortex-M
The Cortex-M85 processor boasts the most recent implementation of the Helium vector processing technology. It brings more ML functionality to edge devices and enhances applications such as robotics, drones, and smart home control.
The Cortex-M55 processor was the first Cortex-M processor with Helium vector processing technology. It brings anomaly and object detection use cases to the edge when implemented standalone. When paired with an NPU (such as the Ethos-U55 discussed earlier in this chapter), gesture detection and speech recognition use cases can be unlocked while still controlling power consumption and cost. Even by itself, the Cortex-M55 has about an order of magnitude (OOM) better ML performance than the next closest, the Cortex-M7.
The Cortex-M7 processor is a superscalar processor, meaning it enables the parallelization of scalar workloads. This effectively allows it to run DSP applications faster, but the more computationally intensive ML use cases are more of a challenge. This processor is suitable for basic ML use cases such as vibration and keyword detection.
The Cortex-M4 processor is often stretched to its computational limits when applied to ML use cases. In most cases, it should only be considered if the ML use case is around vibration/keyword detection or sensor fusion, and there is a strict power or cost constraint.
As the importance and ubiquity of IoT devices have increased in people’s lives, security has become a strong requirement. The basics of security such as cryptographic password storage are no longer acceptable. As the value and volume of what is stored on edge devices increases, malicious actors get proportionally more incentivized for hacks.
We will also devote Chapter 7, Enforcing Security, to the topic of security and dive into more specifics there. This section will give you an overview of the key considerations to remember when selecting a processor with security in mind. To successfully secure your software and project, the underlying hardware needs to enable some essential features such as software isolation, memory protection, secure boot, and more. Arm has implemented a security extension to the newer Cortex-M processors called TrustZone that enhances these security basics, adds more functionality in hardware, and makes security implementations easier. TrustZone enables you to physically isolate sections of memory or peripherals at the hardware level, making hacks more difficult and more contained if they do occur. The full details, benefits, and a quick-start guide for this extension will be provided in a later chapter.
Note that this is an optional extension, so make sure to verify it is enabled for the processor in any development board you are considering.
Using TrustZone and additional security features as a guide, we can rank the Cortex-M processors in terms of security features, as follows:
Figure 1.5 – Ranking security for Cortex-M processors
In practice, these processors all contain the TrustZone security extension and are all excellent options for developing a secure project. They are all based on the Armv8-M instruction architecture, with the other Cortex-M processors being based on Armv7-M or Armv6-M. They are ordered in terms of most recently released, but other requirements such as low power, ML, or DSP performance should decide which of these processors to select. Note that Arm also has a Platform Security Architecture (PSA) certification that validates the security implementations at the development-board level.
The PSA and TrustZone implementations in software are all discussed more in Chapter 7, Enforcing Security. Resources to learn more about the different Arm instruction sets (outside the scope of this book) are listed under the Further reading section at the end of this chapter.
The Cortex-M35P processor is a specialized processor that is intended for the highest level of security. It features built-in tamper resistance and physical protection from invasive and non-invasive attack vectors. Basically, it is ideal for devices that protect valuable resources but are accessible by the public, such as a smart door lock. The core is similar to the Cortex-M33, adding that physical layer of protection. If your product needs physical, tamper-proof security as the primary requirement, this is definitely a Cortex-M processor to consider.
In the embedded space, safety requirements typically come when in a regulated, safety-critical environment. These safety requirements can be categorized as either diagnostic requirements or systematic requirements. Diagnostic requirements relate to the management of random faults on the device and are addressed by the addition of hardware features for fault detection (FD) and control. Systematic requirements relate to demonstrating the avoidance of systematic failures and are addressed typically through the design process and verification.
Products sold to high-safety environments must prove a level of risk reduction as defined by international standards. The International Electrotechnical Commission (IEC) 61508 standard defines general Safety Integrity Levels (SILs), with SIL 4 being the most strict and SIL 1 being the least strict. The automotive industry has a dedicated level system, the Automotive Safety Integration Level (ASIL), with ASIL D being the strictest and ASIL A being the least strict.
- Exception handling, which prevents software crashes in the case of system faults.
- MPUs that ensure data integrity from invalid behavior.
- Software test libraries (STLs) test for faults at startup and runtime. Note that this is not a feature of the processor, but instead, a suite of software tests provided to run on a specific processor.
- Dual-Redundant Core Lockstep (DCLS), where two processors redundantly run the same code to uncover and correct system errors.
- Error Correction Code (ECC), which automatically detects and corrects memory errors.
- Memory Built-In Self-Test (MBIST) interfaces that enable memory integrity validation while the processor is running.
We can rank the Cortex-M processors in terms of safety features, showing the cutoff for which processors are capable of reaching certain safety levels, as follows:
Figure 1.6 – Ranking safety features of Cortex-M processors
The Cortex-M7 is alone in the Cortex-M family in offering ECC, MBIST, and DCLS features alongside the more common MPU and exception handling. The Cortex-M55, Cortex-M33, and Cortex-M23 contain almost all of those features, but are still capable of meeting the strict SIL 3 and ASIL D safety levels.
The Cortex-M4, Cortex-M3, and Cortex-M0+ all offer enough safety features to achieve the least strict SIL 2 and ASIL B safety levels with STLs, MPUs, and exception handling.
The Cortex-M35P processor is highly effective for safety applications as well as security applications. It contains most of the already listed safety features, adding in heightened observability to ensure expected behavior and more.
We can, however, provide some context for what contributes to the cost of a microcontroller, with the largest factor here being the silicon area. As the area of a microcontroller increases, it requires more materials to make and thus intuitively raises costs. Production volume will also impact the cost. The higher the production volume, the lower the cost will be. Typically, the smaller the Cortex-M processor is, the less expensive it will be to manufacture, and thus the lower the price to purchase. We will review the Cortex-M processors with the lowest area so that you have a starting point to look for boards with these processors to have the best chance of minimizing your overall cost.
These Cortex-M processors are highly configurable, and the implementation of more features will increase the area and likely increase cost. In looking for a microcontroller or board while minimizing cost, make sure to select a product with only the minimum set of features you need to hold down the cost as much as possible.
Here are the Cortex-M processors ranked in terms of lowest possible area:
Figure 1.7 – Ranking area of Cortex-M processors
The Cortex-M0 and Cortex-M0+ are tied at the lowest area and are commonly found at the lowest price points. These are excellent choices for low-cost applications if they have enough functionality.
The Cortex-M23 is just behind the Cortex-M0 and Cortex-M0+ in terms of area. The Cortex-M23 has the benefit of enhanced security features, making it a great choice for low-cost connected use cases.
The Cortex-M3, Cortex-M4, and Cortex-M33 all follow, being notably larger than the previous Cortex-M processors. These are the next best options to look at when you need more functionality while keeping costs low.
With this background about selecting Cortex-M processors, let’s look at how to find development boards that include Cortex-M processors.
Microcontroller development boards
Now that we have introduced Cortex-M use cases and guidance on making processor selections based on use cases and other factors such as performance and power, let’s find some development boards and get started learning.
Numerous development boards are available with Cortex-M microcontrollers. While it’s impossible to provide a simple flow chart for how to select a Cortex-M microcontroller, we can provide an overview of the options and trade-offs as a starting point for narrowing the selection.
At the end of this chapter, we will pick two development boards and use those to demonstrate the concepts in the remainder of the book.
There are multiple suppliers for Cortex-M microcontrollers, and each supplier typically offers a wide range of options to optimize for specific markets and use cases. It’s common for a microcontroller supplier to offer hundreds of Cortex-M devices. Each supplier also offers a range of development boards to try out the devices and get started on projects quickly. Here is our recommended list of suppliers to get familiar with:
- Nordic Semiconductor
- Raspberry Pi
- Silicon Labs
- Analog Devices
- Dialog Semiconductor
Microcontrollers and development boards are normally sold by distributors around the world. Some of the common distributors include the following:
Popular boards may also be available online at places such as Amazon and Newegg.
Selecting development boards
- Use cases
- DSP performance
- ML performance
Selecting microcontrollers and development boards introduces a few new factors that impact performance and functionality. These include memory characteristics, power supplies, and peripherals.
Performance is driven by the compute requirements of software applications. Selecting hardware is always easier when the software is well understood, but it’s not always possible. When software is not available, similar applications can be used to estimate performance. There are a variety of industry benchmarks that may provide performance guidance.
As we have seen in previous sections, microcontroller performance is primarily determined by the Cortex-M processor microarchitecture. The next most important factor is memory.
Important CPU factors include the frequency, instruction pipeline, cache, TCM, floating-point hardware, and any special instructions for DSP or vector processing of larger units of data.
Different types of memory are also available in microcontrollers. Most microcontrollers use a mix of static random-access memory (SRAM) and flash memory. Flash memory can be reprogrammed numerous times and holds data when the power is removed. Flash is ideal for storing software instructions.
SRAM provides faster access compared to flash, but the contents are lost when power is removed.
A common software strategy is to move important code and data from flash to SRAM after analyzing to improve performance.
Cortex-M microcontrollers are easy to use because they have a standard memory map that places read-only memory (ROM) or flash memory and SRAM at standard locations in the memory map. This makes it easy to set up regardless of the Cortex-M processor being used.
Looking at the memory access times is key to analyzing performance. Microcontrollers may contain caching systems to feed data from flash memory into a CPU much faster than making a single read access to flash and incurring waits. Instruction and data caches also improve access time to memory.
Power is driven by the operating environment of a product. Requirements to run on a battery, use a specific type of power supply, or maximum current and voltage values to work in each environment should be considered. Certainly, battery versus always plugged in makes a difference, but power consumption has become more complex than just leaving products plugged in and forgetting about power. Products and consumers are starting to focus on using less energy, even in IoT products that are always plugged in, because saving energy across a trillion IoT devices makes a significant difference. Consumers are starting to ask whether every IoT device needs to continuously monitor and report data even while they are sleeping.
Arm processors have a long history of being efficient and using a reasonable amount of power for the performance they provide. Cortex-M processors emphasize simplicity and low-power sleep modes when processing is not needed.
Development boards will provide technical specifications with power details. Using the board specifications in combination with what we have learned about individual Cortex-M processors will help with making good decisions about power.
One key distinction between the thousands of Cortex-M microcontrollers is the peripherals of each device. In fact, this is a common starting point when narrowing down options to make sure desired functionality is supported. The cost-sensitive nature of microcontrollers leads each vendor to develop families of products, selection guides, and tables of products that mix and match various factors such as processor features, peripherals, memory sizes, and temperature ranges. The tables of options can be overwhelming.
One way to understand peripherals is to break them down into a few categories. Today’s IoT devices perform data collection, processing, and data communication. Historically, embedded systems focused on input/output (I/O) pins to connect many types of hardware for data and control.
You can segment peripherals into categories through the following:
- Input from the environment (collecting data from sensors)
- Communication interfaces (storing data)
- Digital and analog I/O signals to interface with additional hardware
A useful exercise to get an understanding of peripherals is to scan through a variety of microcontroller technical summary descriptions and see what is highlighted. These are the key factors the device vendor decided to highlight. This includes a combination of unique features and common features that many devices may have.
Here are some key highlights we found when looking across a variety of devices.
Cortex-M0 and Cortex-M0+ development boards
Some of the common features advertised for Cortex-M0 and Cortex-M0+ boards include general-purpose I/O (GPIO) pins and analog input pins. These allow projects to connect other digital and analog hardware to the board. A Universal Serial Bus (USB) is also common on most development boards for easy connection to software development tools. Some basic sensors may be included for things such as temperature or other climate sensors. Because of the focus on cost and simplicity, another key feature is the types of expansion connectors that are available. This allows users to expand in a generic way to add more interfaces for both data collection and communication to store data. Standardization of connectors brings better compatibility and a wider selection of add-on hardware.
Cortex-M3, Cortex-M4, and Cortex-M7 development boards
Development boards with these Cortex-M processors highlight IoT. Communication features to store data remotely are highlighted, so the boards can immediately be used for IoT applications. Common technologies are Bluetooth Low Energy (BLE), near-field communication (NFC), radio frequency (RF), and Wi-Fi. This class of boards also highlights more advanced sensors such as accelerometers and gyroscopes, as well as pulse width modulation (PWM) to control lights and motors. Analog-to-digital converters (ADCs) and digital-to-analog converters (DACs) are also common to interface with a variety of digital and analog hardware.
Cortex-M23 and Cortex-M33 development boards
Interfaces for these development boards will be similar to the previous group but can be more advanced as the processors are newer and security features enable new applications. Communication interfaces include BLE, Wi-Fi, and Long-Term Evolution (LTE) modems. Specialized antennas may be available for advanced communication protocols such as a NarrowBand-IoT (NB-IoT) antenna. More complex features such as a stereo audio codec are common. Additional storage is possible using a microSD card slot.
Some development boards in all categories include a connector to measure the power of a running system. This helps to make it easy to measure actual power during system development.
In addition to analyzing the Cortex-M processors, memory types, and peripherals, there are several secondary factors to consider when selecting microcontrollers and development boards.
The most important factor is software, which is why we are writing this book. There are numerous software considerations, and these will be covered specifically in the next chapter. Topics are real-time operating system (RTOS) support, connectivity standards, software development kit (SDK) options and programming languages, and software libraries.
Development boards can also be certified by cloud service providers (CSPs) or serve as primary reference boards, for example, software to make it easier to get going right away with a particular RTOS, connectivity standard, or IoT platform for data collection and visualization.
When possible, it’s also good to use benchmark or representative software that is similar to the application to guide performance and code size in selecting the right development board.
An important secondary factor when selecting development boards is the ability to find answers to questions. Because there are so many microcontrollers and development boards, some of them may not have a large or active community of users reporting problems and helping each other find answers. This often makes a significant difference in how fast a new development board can be adopted. If you believe having an active community around a board is helpful, try to search for a representative problem and see whether there are answers available. Some development boards just die out, while others seem to have active developer forums. Raspberry Pi has a large following, and there is so much content it feels like somebody has already tried almost every possible thing to be done with the boards. This makes Raspberry Pi boards easy to learn.
Most microcontrollers themselves are physically very small, but the size of the development board could be very small or somewhat larger. If you want to use a development board to prototype an idea for a new product, it is good to know whether a prototype can be created that is close enough to demonstrate the product concept. Even if a custom board will be created later, having a prototype of useful size may accelerate product development.
Microcontroller products may have temperature ranges assigned to them. Historically, devices that operate over a range of 0°C to 70°C or 85°C are considered consumer-grade. A temperature range of -40°C to 85°C is considered industrial-grade. There may also be special characteristics for automotive microcontrollers. It’s worth checking into these extended temperature ranges if needed, but extending the temperature range comes at a higher price. Industrial IoT is popular and a common place to find extended temperature microcontrollers.
As we write in 2022, the global electronics industry has been suffering from a chip shortage. This has made it harder to find development boards at the various distributors. Having a good handle on availability helps us to know whether more development boards are needed for additional engineers or to build a test lab. Make sure to spend a little time understanding the availability of microcontrollers and development boards before getting too deep into a project. We hope that in the months and years to come, availability will be much less of a factor.
Development board selections
For the upcoming chapters, we selected two boards to demonstrate the concepts and provide detailed steps for you to try things yourself. Trying out the concepts presented in the book is the best way to learn and have the most fun. We selected two boards to cover small Cortex-M devices, security features of Cortex-M, devices with peripherals, and connectivity, as follows:
- Board 1: Raspberry Pi Pico using the Cortex-M0+
- Board 2: NXP LPC55S69-EVK using the Cortex-M33
We will also use a virtual board to demonstrate the concepts of the Cortex-M55.
We tried to avoid boards that are very new or may be difficult to obtain. We also tried to select boards with reasonable prices that can demonstrate newer concepts such as security and network connectivity.
Thankfully, microcontroller development boards are inexpensive, and it’s easy to try a variety of them. If you end up with the wrong CPU performance, not enough memory, or need another peripheral, it’s not difficult to do some more research and try another board.
In this chapter, we provided a survey of important factors to consider when selecting Cortex-M processors, microcontrollers, and development boards. We discussed several criteria for selecting a processor, ranging from use cases to power, performance, security, safety, and cost.
Finally, we proposed two development boards to use in future chapters for hands-on activities. Let us move into Chapter 2, Selecting the Right Software, where we will learn about the broad range of software available for Cortex-M microcontroller projects.
For more information, refer to the following resources:
- Cortex-M processor comparison table: https://developer.arm.com/documentation/102787/
- Cortex-M55 Helium explanation: https://developer.arm.com/Architectures/Helium
- Ethos-U55 resources to understand more about NPUs: https://developer.arm.com/Processors/Ethos-U55
- Armv8-M architecture reference manual: https://developer.arm.com/documentation/ddi0553/
- Armv7-M architecture reference manual: https://developer.arm.com/documentation/ddi0403/
- Armv6-M architecture reference manual: https://developer.arm.com/documentation/ddi0419/