Who is this for?

This is an introductory topic for software developers who would like to learn about context switching operations on Cortex-M processors in a bare-metal environment.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Understand the basics of context switching
  • Learn how to program the Memory Protection Unit (MPU)
  • Learn how to use the SysTick exception with context switching operations
  • Build and run an example project with Arm Development Studio (Arm DS)

Prerequisites

Before starting, you will need the following:

  • Basic knowledge and familiarity with Cortex-M processors.

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll build and run an open source example that demonstrates context switching on Arm Cortex‑M processors in a bare‑metal environment. Using Arm Development Studio, you’ll work with a project that configures the Memory Protection Unit (MPU) and drives switches with the SysTick exception to alternate execution between two threads. You’ll compile the code, run it on a Fast Models Fixed Virtual Platform (FVP), and examine the behavior to understand how MPU setup and SysTick handling interact during a simple real‑time kernel‑style switch. By the end, you’ll recognize the expected thread switching pattern and relate it to the MPU and SysTick configuration used in the example.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Where do I get the example project used in this path?
Use the open source example projects provided alongside the Armv8‑M Memory Model and MPU User Guide. The steps reference the GitHub repository that contains the sources.
Which tools should I use to build and run the project?
Build and run the example with Arm Development Studio, Arm Compiler for Embedded, Fast Models Fixed Virtual Platforms (FVP), and CMSIS at the versions listed in the steps. Use the same versions to match the expected build files and project settings.
What result should I expect when I run the example?
You’ll see a demonstration of simple real‑time kernel context switching between two threads, driven by the SysTick exception and protected by MPU regions. The steps explain how to observe this behavior when the image runs on the FVP.
What should I check if the project doesn't build in Arm Development Studio?
Verify that the toolchain and component versions match the ones listed in the steps. Also confirm that the project references CMSIS correctly and that any include paths align with your workspace layout.
Where is the MPU and SysTick configuration in the project?
Configure the MPU and the SysTick exception in the example’s source files as outlined in the steps. Review the provided code to see where MPU regions are programmed and where the SysTick handler drives the context switch.
Next