Book Image

The Insider's Guide to Arm Cortex-M Development

By : Zachary Lasiuk, Pareena Verma, Jason Andrews
Book Image

The Insider's Guide to Arm Cortex-M Development

By: Zachary Lasiuk, Pareena Verma, Jason Andrews

Overview of this book

Cortex-M has been around since 2004, so why a new book now? With new microcontrollers based on the Cortex-M55 and Cortex-M85 being introduced this year, Cortex-M continues to expand. New software concepts, such as standardized software reuse, have emerged alongside new topics including security and machine learning. Development methodologies have also significantly advanced, with more embedded development taking place in the cloud and increased levels of automation. Due to these advances, a single engineer can no longer understand an entire project and requires new skills to be successful. This book provides a unique view of how to navigate and apply the latest concepts in microcontroller development. The book is split into two parts. First, you’ll be guided through how to select the ideal set of hardware, software, and tools for your specific project. Next, you’ll explore how to implement essential topics for modern embedded developers. Throughout the book, there are examples for you to learn by working with real Cortex-M devices with all software available on GitHub. You will gain experience with the small Cortex-M0+, the powerful Cortex-M55, and more Cortex-M processors. By the end of this book, you’ll be able to practically apply modern Cortex-M software development concepts.
Table of Contents (15 chapters)
1
Part 1: Get Set Up
5
Part 2: Sharpen Your Skills

What this book covers

Chapter 1, Selecting the Right Hardware, covers differences between all Cortex-M CPUs, and by extension the SoCs they are packaged in, based on the use cases and performance requirements of a project. Each use case discussion will center around the practical usage of Cortex-M hardware and software support. Hardware features such as FPUs, TCMs, MVE, and TrustZone will be discussed. Software such as ML frameworks, RTOS, and more will be discussed.

Chapter 2, Selecting the Right Software, introduces the different software frameworks, ranging from bare-metal boot code to real-time operating systems that enable efficient development on Cortex-M embedded devices. We will map popular use cases to software frameworks available today to get them up and running quickly on your Cortex-M devices.

Chapter 3, Selecting the Right Tools, lists the platforms useful for developing products based on Cortex-M hardware. We will list the tools required to work with Cortex-M hardware, with some general commentary to compare them. We will also list the possible development environments people can use, along with the costs and benefits of each.

Chapter 4, Booting to Main, covers the basics of booting a bare-metal program on a Cortex-M device. We will walk you through assembly startup code examples and highlight the key bits that need to be programmed to successfully boot the systems. We will introduce scatter and linker files – what they are, how they’re structured based on memory layout, and how they’re used to link your program to create the final executable. We will also walk you through the different hardware mechanisms that can be leveraged for application input/output, accompanied by relevant examples.

Chapter 5, Optimizing Performance, covers different software optimization techniques that can be used to run your code faster and more efficiently on Cortex-M devices. We will discuss the tools and techniques you can leverage to measure the performance gained using these optimization tips.

Chapter 6, Leveraging Machine Learning, clarifies how Cortex-M devices process machine learning software. The focus will be on the Cortex-M55, the first Cortex-M designed with ML software in mind. We will introduce the difference between how the Cortex-M55 processes ML instructions as opposed to the other Cortex-M devices through vector processing. Then we will dive into the most popular low-power edge ML applications, speech recognition and image classification, and how to leverage software frameworks to get started quickly.

Chapter 7, Enforcing Security, provides an overview of Arm’s TrustZone technology, which provides robust protection and security for IoT devices. We will introduce Trusted Firmware-M and how it can be included and used to build secure firmware for Cortex-M devices. We will also provide software guidelines on topics such as fault detection and exception handling in the context of building secure systems.

Chapter 8, Streamlining with the Cloud, explains the migration of embedded software development to the cloud. We will introduce cloud concepts including source code management, remote code editing, and containers. Examples of various cloud services as well as build-your-own cloud solutions will be provided with software examples to try. Learning cloud development concepts will help you stay up to date with the latest developer trends.

Chapter 9, Implementing Continuous Integration, introduces automated testing, explains why continuous integration is needed, and reviews the challenges it presents. We will explain how to work with various testing frameworks and cloud services and apply them to both physical boards and virtual models. Learning about possible solutions will enable the right level of automation and tools to improve software quality.

Chapter 10, Looking Ahead, provides general tips for how you can go from a good programmer to a great one. Topics for further investigation are presented for you to continue learning. Additional examples of current industry needs are covered, as well as a look forward toward emerging trends and required skills for the future.