# Learn about context switching on Arm Cortex-M processors

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/context-switch-cortex-m/)
- [Example Arm DS project to demonstrate context switching operations](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/context-switch-cortex-m/example/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/context-switch-cortex-m/_next-steps/)

## About this Learning Path

|                        |                       |
|------------------------|-----------------------|
| Skill level:           | Introductory          |
| Reading time:          | 15 min                |
| Last updated:          | 08 Jul 2026           |
| Author:                | Uma Ramalingam, Arm [GitHub](https://github.com/uma-ramalingam) |
| Arm IP:                | [Cortex-M](https://support.arm.com/?tab=compute-ip&Product%20Type=Microcontrollers) |
| Tags:                  | [Performance and Architecture](https://learn.arm.com/tag/performance-and-architecture/) [Baremetal](https://learn.arm.com/tag/baremetal) [CMSIS](https://learn.arm.com/tag/cmsis) [Arm Development Studio](https://learn.arm.com/tag/arm-development-studio) |

### 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?

After completing this Learning Path, you'll be able to perform the following tasks:

- 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'll need the following prerequisites:

- Basic knowledge and familiarity with Cortex-M processors.

### Summary

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.
