Bao'An Shenzhen China

STM32 Unlock: RDP Levels, Recovery & Hard Limits

Oct 31, 2026  /  PCB COPY

stm32 unlock: STM32 microcontroller on PCB with SWD debug wires connected for firmware recovery

STM32 Unlock — What It Actually Means

An STM32 unlock is the process of recovering firmware from an STM32 microcontroller whose flash memory has been protected by ST’s Read-out Protection (RDP) mechanism. At RDP Level 1, authorized recovery of the binary is technically feasible on most STM32F0/F1/F2/F3/F4 and some L-series parts using voltage glitching, debug-interface exploitation, or proprietary toolchains. At RDP Level 2, the JTAG/SWD interface is permanently disabled in hardware, and flash readout is blocked by fuse bits that cannot be reversed — making recovery far more difficult and, on many newer revisions, impossible without destructive die-level techniques.

How STM32 Readout Protection Works

stm32 unlock: STM32 microcontroller on PCB with SWD debug wires connected for firmware recovery

ST Microelectronics implements RDP through option bytes stored in a dedicated information block of the flash. The protection has three discrete states, and the transition rules between them are one-directional past a certain point.

RDP Level Debug Access Flash Read via JTAG/SWD Downgrade Path Firmware Recovery Feasibility
Level 0 (0xAA) Full Allowed N/A — already open Trivial — standard read
Level 1 (any value ≠ 0xAA, ≠ 0xCC) Limited (halt, reset) Blocked Can revert to Level 0 — triggers mass erase Feasible on many families
Level 2 (0xCC) Permanently disabled Permanently blocked Irreversible — no downgrade Extremely limited; die-level only on select parts

The critical detail most datasheets gloss over: transitioning from Level 1 back to Level 0 through the official ST-Link utility erases all flash contents. That is by design. The goal of an STM32 unlock service is to extract the firmware before or without triggering that mass-erase sequence.

Option Byte Locations by Family

On STM32F1xx parts, the option bytes live at 0x1FFFF800. On STM32F4xx, they sit at 0x1FFFC000. The RDP byte is always the first option byte, but the surrounding configuration (write protection, BOR level, watchdog config) varies. Misidentifying the family or revision can lead to an accidental Level 2 lock — an irreversible mistake. Our engineers verify the exact silicon revision (check the DBGMCU_IDCODE register at 0xE0042000) before any attempt.

Which STM32 Parts Can Actually Be Unlocked?

Not every STM32 is equal. The feasibility of an STM32 unlock depends on the specific family, silicon revision, RDP level, and flash size. Here is a realistic breakdown based on our lab experience:

STM32 Family RDP1 Recovery RDP2 Recovery Typical Turnaround Notes
STM32F0xx High success Very limited 3–7 working days Older revisions more susceptible to glitch attacks
STM32F1xx High success Limited 3–7 working days Most commonly requested family
STM32F2xx Moderate–High Very limited 5–10 working days Dual-bank flash adds complexity
STM32F4xx Moderate Rarely feasible 5–12 working days Newer revisions have hardened glitch countermeasures
STM32L0xx / L1xx Moderate Rarely feasible 5–10 working days Ultra-low-power families; smaller flash
STM32G0xx / G4xx Low–Moderate Not feasible Requires evaluation TrustZone-capable parts resist known vectors
STM32H7xx Low Not feasible Requires evaluation Cortex-M7 with hardware security extensions
STM32WB / WL Not feasible Not feasible N/A Secure element integration blocks known approaches

We decline jobs where we assess the probability of non-destructive recovery below a reasonable threshold. That honesty saves you time and money. If you are unsure which RDP level your chip is at, we offer a free feasibility check before any commitment.

How STM32 Unlock Is Performed

Step 1 — Identification and RDP Level Verification

The chip is connected via SWD (SWDIO + SWCLK) or JTAG (TMS/TCK/TDI/TDO). Even under RDP1, the debug port responds to certain commands — enough to confirm the device ID, flash size register (at 0x1FFF75E0 on F4, 0x1FFFF7E0 on F1), and the current RDP state. If the port is completely dead, that usually indicates RDP2.

Step 2 — Attack Vector Selection

For RDP Level 1 parts, the primary approaches include:

  • Voltage glitching (VCC fault injection): A precisely timed voltage dip during the RDP-check routine causes the CPU to skip the protection branch. Timing windows are typically 5–50 ns on F1 parts, narrowing to under 10 ns on F4 Rev Y and later.
  • Electromagnetic fault injection (EMFI): A focused EM pulse near the flash controller can achieve similar skip effects without physical contact to VCC. More effective on BGA packages where power pins are less accessible.
  • Debug interface exploitation: Certain boot-ROM vulnerabilities on older silicon revisions allow partial flash reads through carefully sequenced debug halt/step commands.
  • Cold boot / SRAM analysis: On parts where firmware copies segments to SRAM at startup, a fast debug attach during the boot sequence can capture decrypted data before the RDP lockout engages.

The specific technique depends on the package (LQFP-48 is easier to probe than WLCSP-36), the silicon revision, and the clock configuration baked into the option bytes.

Step 3 — Firmware Extraction and Verification

Once the protection is bypassed, the full flash contents are read out as a raw binary (.bin) or Intel HEX (.hex) file. We verify the dump by comparing CRC32 checksums across multiple independent reads — a minimum of three passes. If any discrepancy appears, the extraction is repeated. The delivered file includes the interrupt vector table starting at 0x08000000, which the client can load directly into a programmer or disassembler.

What You Receive After an STM32 Unlock

  • Raw binary dump (.bin) of the full flash region
  • Intel HEX file (.hex) for direct programming
  • Option byte dump (RDP state, write-protect sectors, BOR level)
  • Flash map noting used vs. empty sectors
  • CRC32 verification report across extraction passes

If you need the firmware loaded onto a replacement STM32 (same part number), we can program and verify the target chip as an additional service.

RDP Level 2: The Hard Limit

Decapped IC under microscope with microprobing needles for die-level analysis

Engineers sometimes ask us to recover firmware from an STM32 locked at RDP Level 2. We are transparent about this: on most current-production STM32 families, RDP2 recovery is not feasible through non-destructive means. The JTAG/SWD port is physically disconnected by blown fuses inside the option-byte controller. No software or electrical glitch can re-enable it.

On a small number of older STM32F1xx revisions (Rev Z and earlier, manufactured before roughly 2014), die-level microprobing of the flash array has succeeded in academic and commercial settings. This involves decapping the IC, locating the flash bitcell array under a scanning electron microscope, and reading individual cells. The process is destructive to the package, takes 3–6 weeks, costs significantly more (typically 5–20× the cost of an RDP1 recovery), and success is not guaranteed on every die.

For newer silicon — STM32F4 Rev Y+, all G-series, all H-series — ST has added additional countermeasures (scrambled flash layout, encrypted bitcells) that make even die-level reads impractical. We will tell you upfront if your part falls into this category.

Authorization and Legal Requirements

We perform STM32 unlock exclusively for authorized parties: original designers recovering lost source, maintenance engineers supporting legacy equipment, or companies with documented IP ownership. Every engagement requires proof of ownership or written authorization, and work is performed under NDA. Read our full policy on the legality of IC unlock and the jobs we decline.

STM32 vs. Other ARM Cortex-M Families

STM32 is not the only Cortex-M family with readout protection, and engineers maintaining mixed-vendor designs often need to understand the differences:

  • GD32 (GigaDevice): Pin-compatible STM32 clones with a different SWD protection implementation. Recovery vectors differ significantly. See our GD32 unlock guide for the practical differences.
  • NXP Kinetis MKE02 / MK60: Uses FSEC (Flash Security) byte instead of RDP. The unlock path involves different tooling and timing. We cover these in our MKE02 recovery and MK60 recovery pages.
  • Nuvoton NUC131: Uses its own flash lock mechanism with a config0/config1 register pair. Different attack surface entirely. Details at our NUC131 unlock feasibility page.

Cross-referencing the protection scheme matters because some “STM32” boards actually carry GD32 or CKS32 clones, and applying STM32-specific techniques to them will fail or, worse, permanently lock the device.

Pricing and Turnaround Signals

STM32 unlock pricing depends on the RDP level, family, and package. As a general guide:

Scenario Typical Price Range (USD) Turnaround
STM32F1xx, RDP1, LQFP package $300–$600 3–7 working days
STM32F4xx, RDP1, LQFP package $500–$1,200 5–12 working days
STM32F1xx, RDP2, die-level attempt $3,000–$8,000+ 3–6 weeks
BGA/WLCSP packages (any family) +30–50% vs. LQFP +2–5 days

These are starting ranges, not fixed quotes. Exact pricing requires evaluating your specific chip. We never charge if the feasibility assessment determines recovery is not viable.

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 review
Can STM32 RDP Level 2 be reversed?

On most current-production STM32 families, RDP Level 2 is irreversible. The debug port is permanently disabled by internal fuses. On a limited number of older STM32F1xx revisions (pre-2014 silicon), die-level microprobing has succeeded, but the process is destructive, expensive, and not guaranteed. Newer G-series and H-series parts include flash scrambling that blocks even die-level reads.

Will the STM32 unlock process damage my chip?

For RDP Level 1 recovery using voltage glitching or debug exploitation, the chip is not damaged — the original flash contents remain intact, and the device continues to function normally afterward. For RDP Level 2 die-level attempts, the IC package is destroyed during decapping, and the silicon die may be damaged during probing. We always clarify which approach applies before starting.

How do I know which RDP level my STM32 is set to?

Connect the chip via SWD using an ST-Link or J-Link. If you can read the device ID but flash reads return all 0x00 or 0xFF, the part is likely at RDP1. If the debug port does not respond at all (no ACK on SWD), the part is likely at RDP2. Our free feasibility check confirms the exact state before any work begins.

Do I need to prove I own the firmware to request STM32 unlock?

Yes. We require proof of ownership or written authorization from the IP holder before performing any firmware extraction. This can be a purchase order for the original development, a company letterhead authorization, or documentation showing you designed the product. We detail our policy on IC unlock legality and authorization.

My board has an STM32 but the markings are sanded off. Can you still help?

Often, yes. We can identify the specific STM32 variant by probing the SWD port (the IDCODE register reveals the family), examining the PCB footprint and pin count, and cross-referencing with the board’s peripheral connections. If the part turns out to be a GD32 or CKS32 clone, we adjust our approach accordingly.

Related IC Unlock Services

Beyond STM32, our lab handles firmware recovery across a range of microcontroller and memory IC families. If your project involves multiple chip types on the same board, we can evaluate them together:

  • GD32 series — STM32-compatible but different protection
  • NXP Kinetis MK60 flash security recovery
  • Nuvoton NUC131 config-lock bypass
  • Full IC unlock service with free feasibility assessment

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 review

Working on a board like this?

Send the chip marking or two photos. You get feasibility, lead time and price within 24 hours, and the check costs nothing.

Get a free quote

Related reading

WhatsApp Send board details