Application note

How to use error correction code (ECC) management for internal memories protection on STM32 MCUs

Rev 8 - February 2026

Introduction

This application note describes the error correction code (ECC) management and implementation on STM32 microcontrollers. This document presents both the hardware and software aspects linked to the ECC mechanism used to protect the content of internal memories. ECC protection with external memories is possible, however, its implementation is out of the scope of this document.

This document presents: general information about ECC protection, detailed hardware ECC fault management, and details of how ECC is implemented, with special focus on high performance microcontrollers. This document proposes a specific implementation of the software part of the safety solution.

This document complements the Reference documents, available on www.st.com.

Table 1. Applicable products
TypeProducts
MicrocontrollerSTM32H5 series, STM32H7 series, STM32U3 series, STM32U5 series, STM32C5 series

General information

This document applies to STM32H5, STM32H7, STM32C5, STM32U3, and STM32U5 series microcontrollers, which are Arm®‑based devices.



Note:

Arm and Cortex are registered trademarks of Arm Limited (or its subsidiaries or affiliates) in the US and/or elsewhere.

The Arm word and logo are trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. All rights reserved.

Table 2. Acronyms and terms
AcronymDefinition
ECCError correction code
CPUCentral processing unit (part of the MCU)
CRCCyclic redundancy check
DEDDouble-error detection
DTCMData-tightly coupled memory
FARFalling address register
ISRInterrupt service routine
ITCMInstruction tightly coupled memory
MCUMicrocontroller unit
MDMAMaster direct-memory access
PORPower-on reset
RAMRandom access memory
SECSingle-error correction
SRAMStatic RAM

 

 

Reference documents

[1]Reference manual STM32H503 Arm®-based 32-bit MCUs (RM0492)
[2]Reference manual STM32H563/H573 and STM32H562 Arm®-based 32-bit MCUs (RM0481)
[3]Reference manual STM32H7A3/7B3 and STM32H7B0 value line advanced Arm®-based 32-bit MCUs (RM0455)
[4]Reference manual STM32H745/755 and STM32H747/757 advanced Arm®-based 32-bit MCUs (RM0399)
[5]Reference manual STM32H723/733, STM32H725/735, and STM32H730 value line advanced Arm®-based 32-bit MCUs (RM0468)
[6]Reference manual STM32U5 series Arm®-based 32-bit MCUs (RM0456)
[7]User manual STM32H7 dual-core safety manual (UM2840)
[8]Reference manual STM32U3 series advanced Arm®-based 32-bit MCUs (RM0487)