Readout protection is a hardware-enforced mechanism inside a microcontroller that blocks external access to on-chip flash memory, EEPROM, and SRAM through debug interfaces such as JTAG or SWD. Vendors implement it using option bytes (STM32 RDP), configuration fuses (PIC, AVR), or security bits (SAM), each offering one or more escalating protection levels that trade recoverability for security strength.
What Is Readout Protection and Why Does It Exist?
Every modern MCU ships with a debug port that lets engineers program, verify, and step through code. Without readout protection, anyone with a $15 debug probe can dump the entire flash contents in seconds. That is a serious problem for OEMs shipping production firmware containing proprietary algorithms, calibration tables, or licensed protocol stacks.
Readout protection solves this by inserting a gate between the debug interface and the memory bus. When protection is active, read commands issued over SWD/JTAG return zeros, trigger a bus fault, or simply disconnect the debug logic entirely. The specific behavior depends on the vendor, the MCU family, and the protection level selected.
For authorized owners performing legacy maintenance, board-level repair, or IP recovery on their own designs, understanding exactly which protection level is set—and what it permits or destroys—is the first step toward a feasible firmware recovery strategy.
How Readout Protection Works Across Major MCU Families

STM32: RDP Levels 0, 1, and 2
STMicroelectronics uses a system of option bytes stored in a dedicated flash region. The critical byte is the RDP (Read-out Protection) field, which accepts three states:
| RDP Level | Option Byte Value | Debug Access | Flash Read via SWD | Regression Possible? |
|---|---|---|---|---|
| Level 0 | 0xAA | Full | Yes | N/A (unprotected) |
| Level 1 | Any value ≠ 0xAA, ≠ 0xCC | Partial (halt, register read) | No — returns bus error | Yes — mass erase triggered on regression to L0 |
| Level 2 | 0xCC | Permanently disabled | No | No — irreversible, JTAG fuses blown |
Level 1 is the most commonly encountered state in production devices. The debug port remains physically active—you can connect, halt the core, and read CPU registers—but any attempt to read flash or SRAM over the debug bus is blocked by the memory protection unit. Regressing from Level 1 to Level 0 is possible, but STM32 hardware forces a full mass erase of flash before the option byte change takes effect. This is by design: you get your debug access back, but the firmware is gone.
Level 2 is a permanent lock. The option byte region itself becomes unwritable, and the debug port is physically disconnected at the silicon level. On STM32F4 and newer families, this involves blowing one-time-programmable (OTP) fuses. There is no documented path back. Chips like the STM32U5 series with TrustZone integration add additional secure-area partitioning on top of RDP, making Level 2 especially robust.
Even within the STM32 ecosystem, behavior varies. The STM32C0 entry-level family implements a simplified RDP scheme compared to the STM32H7, which adds secure boot and external memory protection. The STM32WL LoRa-capable line layers radio-specific key storage on top of standard RDP. Engineers must consult the specific reference manual—not just the family datasheet—for exact behavior.
STM8: Readout Protection via Option Bytes
STM8 devices use a simpler binary protection model: readout protection is either enabled or disabled, controlled by an option byte at address 0x4800. When enabled, the SWIM debug interface cannot read flash or EEPROM. Unlike STM32 RDP Level 2, STM8 readout protection is generally reversible—but regression triggers a full flash erase, identical in concept to STM32 Level 1 regression.
Families like the STM8L low-power series add a separate data EEPROM protection bit, meaning flash and EEPROM can be locked independently. This is a detail many engineers overlook when planning a recovery approach.
Microchip PIC: Code Protection Fuses (CP, CPD, WRT)
Microchip’s PIC architecture uses configuration fuses—bits programmed during device programming that live in a special configuration word, not in the main flash array. The relevant fuses include:
- CP (Code Protect): Blocks external read of program flash via ICSP.
- CPD (Data Code Protect): Blocks external read of data EEPROM.
- WRT (Write Protect): Prevents self-write to flash regions, often used alongside CP.
- CPB (Boot Block Code Protect): On PIC18 and higher, independently protects the boot block.
On 8-bit PIC devices (PIC10, PIC12, PIC16, PIC18), these fuses are typically all-or-nothing per memory region. A bulk erase clears both the flash and the configuration fuses, returning the device to an unprotected state—but, again, the firmware is destroyed in the process.
Higher-end Microchip parts introduce more granularity. PIC24 and dsPIC33 families support segment-level protection, where flash is divided into segments (typically 1–4 KB each) that can be independently read-protected or write-protected. The PIC24H family uses General Segment and Secure Segment partitions, each with independent code-protect fuses. 32-bit PIC32 devices extend this further with boot flash protection, program flash protection per region, and JTAG disable bits.
Microchip SAM (ARM Cortex-M): Security Bit and Boot Protection
Atmel (now Microchip) SAM devices use an NVMCTRL security bit. Setting this bit disables external access to flash via SWD. The critical detail: on most SAM devices, the only way to clear the security bit is a chip erase command that wipes all flash, all SRAM, and resets the security bit. This is functionally identical to STM32 RDP Level 1 regression.
Devices like the ATSAMD21 and ATSAMD51 also support boot protection regions (BOOTPROT fuse), which lock a configurable portion of flash starting at address 0x00000000. This region survives a chip erase on some variants, meaning the bootloader can persist even after security bit clearing—a useful detail for recovery scenarios where the bootloader itself is the target.
Readout Protection Comparison Table
| Vendor / Family | Mechanism | Levels | Reversible? | Erase on Regression? | Granularity |
|---|---|---|---|---|---|
| STM32 (all) | RDP option byte | 3 (L0/L1/L2) | L1→L0 yes; L2 no | Yes (mass erase) | Whole-chip (L1/L2); per-area with WRP |
| STM8 | Option byte | 2 (on/off) | Yes | Yes (full erase) | Flash + EEPROM separate on some |
| PIC10/12/16/18 | Config fuses (CP, CPD) | 2 (on/off per region) | Yes (bulk erase) | Yes | Per memory block on PIC18 |
| PIC24 / dsPIC33 | Config fuses + segments | Multi-segment | Yes (bulk erase) | Yes | Per segment (1–4 KB) |
| PIC32MZ/MM | Config fuses + boot protect | Multi-region | Yes (bulk erase) | Yes | Boot + program regions |
| ATSAM3/4/D21/D51 | Security bit (NVMCTRL) | 2 (set/clear) | Yes (chip erase) | Yes | Whole-chip; BOOTPROT separate |
| Nordic nRF52 | APPROTECT register | 2 (on/off) | Yes (ERASEALL) | Yes | Whole-chip |
| Renesas RL78 | Security ID + boot cluster | 2 | Conditional | Yes | Boot area separate |
What Happens When You Need the Firmware Back?

Readout protection does its job well—sometimes too well. Common scenarios where authorized owners need to recover firmware from a protected chip include:
- Lost source code: The original developer left, the repository was lost, and the only copy of the firmware exists on production hardware.
- Obsolete equipment repair: A critical industrial controller uses a discontinued MCU. The board failed, and a replacement chip needs the original firmware.
- Design migration: You need to port firmware from a legacy MCU to a pin-compatible replacement, and you need the binary as a starting point for disassembly.
- Quality audit: Verifying that a contract manufacturer programmed the correct firmware version onto production boards.
In every case, the fundamental constraint is the same: standard debug tools cannot read the flash while readout protection is active. Regression (clearing the protection) destroys the data. This is where specialized recovery techniques—glitch attacks, side-channel analysis, laser fault injection, or silicon-level probing—become relevant.
Recovery Feasibility by Protection Level
Not all protection levels are equal in difficulty. A rough hierarchy:
- Software-only locks (security bit, RDP L1): Protection is enforced by logic gates that can potentially be bypassed through voltage or clock glitching. Success rates vary by family and silicon revision. Older STM32F1 devices are well-studied; newer STM32L5/U5 parts with hardware security modules are significantly harder.
- Fuse-based locks (RDP L2, PIC code-protect with fuse-blow): One-time-programmable fuses physically disconnect debug logic. Recovery requires invasive techniques—decapping, microprobing, or FIB (focused ion beam) circuit editing. Cost and turnaround increase substantially.
- Hardware security modules (TrustZone, PCROP, secure enclaves): Modern MCUs with dedicated crypto accelerators and secure boot chains present the highest barrier. Firmware may be encrypted at rest, meaning even a successful flash dump yields ciphertext without the key.
Our engineers evaluate each chip on a case-by-case basis. We require proof of ownership or written authorization before beginning any recovery work, and we document the chain of custody throughout the process. For details on our authorization requirements, see our trust and compliance policy.
Common Misconceptions About Readout Protection
“RDP Level 2 means the chip is 100% unrecoverable”
In practice, RDP Level 2 is extremely difficult to bypass, but “impossible” is a strong word in hardware security. Academic papers have demonstrated successful glitch attacks against specific STM32 silicon revisions even at Level 2. However, these attacks require expensive equipment (sub-nanosecond voltage glitchers, EM probes), deep knowledge of the target’s boot sequence, and often dozens of hours of lab time per chip. For most practical purposes, Level 2 is a hard stop—but feasibility depends on the exact part number and revision.
“Code-protect fuses are just software flags”
On PIC devices, configuration fuses are stored in a physically separate region from program flash. They are not ordinary memory locations that can be patched. Bulk erase is the only standard mechanism to clear them, and it erases everything. Treating them as “just a bit to flip” leads to destroyed devices.
“I can read flash through the bootloader even with protection on”
Some engineers assume the built-in UART/USB bootloader bypasses readout protection. On STM32, this is explicitly not the case—the system bootloader respects RDP settings. At RDP Level 1, the bootloader allows write and erase but blocks read commands. At Level 2, the system bootloader is entirely disabled on most families.
How to Check the Current Protection Level
Before planning any recovery, identify what you are dealing with:
- STM32: Connect via SWD using STM32CubeProgrammer. The option byte tab shows the current RDP level. If the tool cannot connect at all, suspect RDP Level 2.
- PIC: Use MPLAB IPE. Attempt a “Read” operation. If code-protect is set, the tool reports “Code-protected device” and returns blank data.
- SAM: Use Atmel Studio / MPLAB X with an Atmel-ICE. The Device Programming dialog shows the security bit state. If SWD fails to connect, the security bit is likely set.
Check feasibility for your project
Send the chip marking or board details and tell us what you need to recover. Add clear photos if available.
Request a feasibility reviewCan readout protection be bypassed without erasing the firmware?
It depends entirely on the MCU family, silicon revision, and protection level. Software-enforced locks (RDP Level 1, SAM security bit) have been bypassed on certain older parts using voltage glitching or electromagnetic fault injection, leaving flash contents intact. Fuse-blown protections (RDP Level 2) require invasive physical techniques with lower success probability. No blanket answer applies—each chip requires individual feasibility assessment.
Is recovering firmware from a readout-protected chip legal?
Recovering firmware you own—from your own design, your own production hardware, or under written authorization from the IP holder—is legal in most jurisdictions. It falls under maintenance, interoperability, or IP recovery provisions. Extracting someone else’s proprietary firmware without authorization is not. We require proof of ownership or a signed authorization letter before starting any recovery project. See our authorization and compliance policy for details.
Does readout protection protect against physical attacks?
Standard readout protection (RDP L1, security bits, config fuses) is designed to block logical access through debug interfaces. It does not protect against physical attacks such as decapping and microprobing, laser fault injection, or FIB circuit editing. Higher protection levels (RDP L2, secure enclaves) add resistance to some physical attacks, but no protection is absolute against a sufficiently funded and skilled attacker with physical access to the silicon.
What is the difference between readout protection and write protection?
Readout protection blocks external read access to flash memory—preventing firmware extraction. Write protection (WRP on STM32, WRT on PIC) blocks write and erase operations to specific flash sectors—preventing accidental or malicious firmware modification. They are independent mechanisms and can be configured separately. A device can be write-protected but readable, or read-protected but internally writable.
How long does an authorized firmware recovery take?
Turnaround depends on the protection level and MCU family. For software-enforced locks on well-studied families (STM32F1/F4 at RDP L1, older PIC16/18), recovery can take 3–7 working days. Fuse-based or invasive recoveries (RDP L2, secure-boot devices) may take 2–6 weeks and require a feasibility study first. We provide a realistic timeline estimate after evaluating your specific chip.
{
“@context”: “https://schema.org”,
“@type”: “Article”,
“headline”: “Readout Protection Explained: How RDP, Lock Bits & Fuses Guard MCU Firmware”,
“description”: “Technical guide covering readout protection mechanisms across STM32, PIC, and SAM microcontroller families, including RDP levels, configuration fuses, security bits, and authorized recovery options.”,
“url”: “https://pcb-copy.com/readout-protection/”,
“publisher”: {
“@type”: “Organization”,
“name”: “PCB-Copy.com”
}
}
What do you need to recover?
Send the full marking or board photos, sample condition and required outcome. Ask for an NDA before sharing confidential files. Scope and sample handling are confirmed individually.
The article title is carried into the contact form. Add your own details and review the enquiry before sending.