ARM Program Status Registers

The ARM Program Status Registers (PSRs) are special purpose 32-bit registers that control and reflect the state of the processor. The PSRs allow the operating system to quickly determine the current state of the processor, and allow low-level code to efficiently modify the execution environment. There are five PSRs – Current Program Status Register (CPSR),

Tips for Using the FPU on Cortex-M4 Efficiently

The Cortex-M4 processor includes a single precision floating point unit (FPU) that can significantly improve the performance of math-intensive code. However, to utilize the FPU efficiently requires some care in coding and optimization. Here are some tips for getting the most out of the Cortex-M4 FPU: Enable the FPU in Your Toolchain The first step

Memory Options and Tradeoffs in ARM Cortex-M

ARM Cortex-M microcontrollers offer a variety of memory options to choose from. Selecting the right memory configuration requires balancing factors like cost, performance, power consumption, and flexibility. This article provides an overview of the key memory technologies used in Cortex-M devices and discusses the tradeoffs involved in selecting between them. SRAM Static RAM (SRAM) is

Loading the EXC_RETURN Value for Cortex-M Context Switching

Context switching between threads or tasks on Cortex-M processors involves saving the context of one thread or task, then loading the context of another. A key part of the context is the EXC_RETURN value, which controls the processor state when returning from an exception. Care must be taken when loading the EXC_RETURN value during a

Saving and Restoring Task Context on Cortex-M

When working with preemptive multitasking on Cortex-M microcontrollers, it is often necessary to save and restore the context of a task when switching between tasks. The context includes the values of the CPU registers, stack pointer, and other key state information that must be preserved when transitioning between tasks. What is Task Context? The task

Explanation of (Cortex-M3) STM32F1 Boot Modes and Memory Mapping

The STM32F1 series of microcontrollers based on the Cortex-M3 core from STMicroelectronics offer several boot modes and flexible memory mapping options. Understanding these boot modes and memory maps is key to leveraging the capabilities of these powerful chips. STM32F1 Boot Modes There are several boot modes available on STM32F1 devices to accommodate different application requirements:

What are the post-indexed addressing modes in Arm Cortex M?

Post-indexed addressing modes in Arm Cortex M refer to addressing modes where the address is calculated first before being used, and then the address register is updated after. This allows efficient accessing of data structures like arrays or buffers where you want to increment the address after each access. The key benefit is that the

SysTick Interrupt Handler Design Tips for Cortex-M

The SysTick timer is an essential peripheral found in all Cortex-M processors. It allows precise timing of events and periodic software execution. The SysTick interrupt handler, which executes when the timer expires, is a critical part of any Cortex-M firmware. Well-designed interrupt handlers improve system robustness and determinism. This article provides practical design tips for