The Insider's Guide to Arm Cortex-M Development

Book description

Learn and implement the latest Arm Cortex-M microcontroller development concepts such as performance optimization, security, software reuse, machine learning, continuous integration, and cloud-based development from industry experts

Key Features

  • Learn how to select the best Cortex-M hardware, software, and tools for your project
  • Understand the use of key software components and how to optimize and develop modern applications
  • Get hands-on experience implementing quality software using example code provided in the book
  • Purchase of the print or Kindle book includes a free eBook in the PDF format

Book Description

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.

What you will learn

  • Familiarize yourself with heuristics to identify the right components for your Cortex-M project
  • Boot code to efficiently start up a Cortex-M device
  • Optimize algorithms with compilers, middleware, and other means
  • Get to grips with machine learning frameworks and implementation techniques
  • Understand security in the embedded space with solutions like TrustZone and TF-M
  • Explore cloud-based development methodologies to increase efficiency
  • Dive into continuous integration frameworks and best practices
  • Identify future trends that could impact Cortex-M software development

Who this book is for

This book is for practicing engineers and students working with embedded and IoT systems who want to quickly learn how to develop quality software for Arm Cortex-M processors without reading long technical manuals. If you're looking for a book that explains C or assembly language programming for the purpose of creating a single application or mastering a type of programming such as digital signal processing algorithms, then this book is NOT for you. A basic understanding of embedded hardware and software, along with general C programming skills will assist with understanding the concepts covered in this book.

Table of contents

  1. The Insider’s Guide to Arm Cortex-M Development
  2. Contributors
  3. About the authors
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1: Get Set Up
  7. Chapter 1: Selecting the Right Hardware
    1. Processor selection through use cases
      1. Medical wearable
      2. Industrial flow sensor
      3. IoT sensor
      4. ML
    2. Processor selection based on performance and power
      1. Power
      2. DSP performance
      3. ML performance
      4. Security
      5. Safety
      6. Cost
    3. Microcontroller development boards
      1. Suppliers
    4. Selecting development boards
      1. Performance
      2. Power
      3. Peripherals
    5. Summary
    6. Further reading
  8. Chapter 2: Selecting the Right Software
    1. Overview of bare-metal software
    2. Overview of RTOSs
    3. Exploring middleware and libraries
      1. CMSIS
      2. DSP libraries
      3. ML frameworks and libraries
    4. Understanding secure software
      1. PSA
      2. Trusted Firmware for Cortex-M
    5. Implementing safe software
    6. Example software stacks for common use cases
      1. Medical wearable
      2. Industrial flow sensor
      3. IoT sensor
      4. ML
    7. Introducing SDKs for Cortex-M
      1. Purpose of an SDK
      2. Language bindings
      3. Middleware
      4. Cloud connectors
      5. Security and encryption
      6. Development tools
      7. Build systems
      8. Lower-level considerations
    8. Looking at some available SDKs
      1. Raspberry Pi
      2. NXP
      3. ST
    9. Summary
    10. Further reading
  9. Chapter 3: Selecting the Right Tools
    1. Examining development platforms
      1. Software-centric development platforms
      2. Hardware-centric development platforms
      3. Metrics for evaluating development platforms
    2. Exploring compilers
      1. Arm Compiler for Embedded
      2. Arm Compiler for Embedded FuSa
      3. GNU Arm Embedded Toolchain
    3. Navigating IDEs
      1. Keil MDK
      2. Arm Development Studio
      3. IAR Embedded Workbench for Arm
      4. Arduino IDE
      5. Visual Studio Code
    4. Understanding development environments
      1. Interactive versus automated development
      2. Local environments
      3. Virtual environments
      4. Cloud environments
    5. Summary
    6. Further reading
  10. Part 2: Sharpen Your Skills
  11. Chapter 4: Booting to Main
    1. The basics of hello world
    2. Arm Virtual Hardware using the Cortex-M55
      1. Running hello world
      2. Startup code
      3. Memory mapping
      4. I/O mechanisms
    3. NXP LPC55S69-EVK using the Cortex-M33
      1. Running Blinky
      2. Startup code
      3. Memory mapping
      4. I/O mechanisms
    4. The Raspberry Pi Pico using the Cortex-M0+
      1. Running hello world and Blinky
      2. Starting from scratch
      3. I/O mechanisms
      4. Startup code
      5. I/O mechanisms (using the UARTs this time)
      6. Debugging tips
    5. Summary
    6. Further reading
  12. Chapter 5: Optimizing Performance
    1. Our algorithm – the dot product
    2. Measuring cycle count
      1. System Tick Timer
      2. Data Watchpoint and Trace
    3. Measuring dot product performance
      1. Using the Raspberry Pi Pico
      2. Using NXP LPC55S69-EVK
      3. Using Arm Virtual Hardware
    4. Optimization takeaways
      1. Processor performance
      2. Compilers
      3. Compiler flags
      4. Source code / algorithm implementation
    5. Summary
    6. Further reading
  13. Chapter 6: Leveraging Machine Learning
    1. Understanding the ML application life cycle
    2. Investigating ML frameworks and libraries
      1. TensorFlow Lite for Microcontrollers
      2. CMSIS-NN
      3. TinyML
    3. Exploring ML use cases
      1. Anomaly detection – vibration
      2. Image classification – vision
      3. Micro speech – voice
    4. Summary
    5. Further reading
  14. Chapter 7: Enforcing Security
    1. Breaking down PSA
      1. Analyze – threat modeling and the 10 security goals
      2. Architect – References, suggestions, and APIs
      3. Implement – Creating a secure system
      4. Certify – PSA certification levels
    2. Example 1 – Secure versus non-secure hello world
      1. Obtaining and building the application
      2. Switching security states
      3. Calling a secure function from a non-secure state
    3. Example 2 – TF-M
      1. Obtaining and building the application
      2. Running the test suite
      3. Analyzing a RoT service connection test
    4. Summary
    5. Further reading
  15. Chapter 8: Streamlining with the Cloud
    1. The fundamentals of cloud development
    2. Coding and containers in the cloud
      1. Using VS Code via
      2. Dev containers
      3. Dev container services
      4. Initializing Gitpod
      5. Workspace images
    3. A crash course on containers
      1. Creating a Dockerfile
      2. Building and storing the containers
      3. Building arguments and multi-architecture support
      4. Running the dev containers
      5. Integrating dev containers with VS Code
    4. Executing software and debugging in the cloud
      1. Creating a custom Gitpod image
    5. Running and debugging
    6. Getting to know Keil Studio Cloud
    7. Other cloud development possibilities
      1. Cloud virtual machines
      2. Virtual desktop in VM
    8. Summary
    9. Further reading
  16. Chapter 9: Implementing Continuous Integration
    1. Understanding the value of CI
    2. Why embedded software CI can be challenging
      1. Replacing board farms with virtual farms
    3. Examples of CI flows
      1. 1 – Simple test scripts
      2. 2 – In-house board farm setup
      3. 3 – A virtual farm with AVH
    4. Summary
    5. Further reading
  17. Chapter 10: Looking Ahead
    1. The now – tips to being a great developer
      1. The cloud
      2. Testing, CI, and safety
      3. Exploring useful examples and code
      4. Official Arm projects under development
    2. The future – how trends will affect Cortex-M developers
      1. Trend 1 – 5G and the Internet of Everything
      2. Trend 2 – environmental sustainability
      3. Trend 3 – decentralization of information
    3. The end
  18. Index
    1. Why subscribe?
  19. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: The Insider's Guide to Arm Cortex-M Development
  • Author(s): Zachary Lasiuk, Pareena Verma, Jason Andrews
  • Release date: October 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781803231112