PostHeaderIcon Attack Locked STM32G474RET6 Program: LQFP64 512 KB Recovery

The STM32G474RET6 is the flagship density of the 64-lead G4 line, carrying 512 KB of dual-bank flash with the HRTIM high-resolution timer inside the same 10×10 mm LQFP64 that the smaller parts use. To attack locked STM32G474RET6 program you rank the available surfaces and move on the first one that yields.

Ranking the attack surfaces

The first surface is the SWD debug gate, which links at the physical layer but refuses the flash window at 0x08000000 when readout protection is set. The second is the system bootloader gate, which honours the same option-byte decision and declines its read command in the same place.

The debug and bootloader gates

On the STM32G474RET6 the SWD access port answers a probe and then fails the moment the flash is read, and the ROM bootloader behaves identically because it samples the same level from the option bytes at reset. Regressing level 1 to 0 wipes the 512 KB, so the unlock is never the objective. The same caution appears in our flash protection methods reference. Microprobing is the fallback when the optical path is awkward, and it works at level 2 where nothing else does. The same warning appears in our flash protection methods reference.

Glitching as an alternative

Voltage and clock glitching perturb the core precisely as the security check runs, hoping to make the comparison fall through for the instants needed to read a block.

The two variants work on different parts of the circuit. A voltage glitch collapses the supply momentarily so that a comparison inside the security routine is evaluated against a marginal reference, while a clock glitch stretches or compresses a single cycle so the routine takes the wrong branch. Both are cheap to attempt and neither requires the package to be opened. The limits are real: the window is narrow, the attempt often only succeeds on a minority of samples, and a failed attempt leaves the part still locked.

Decap and optical fault injection

When both software doors stay shut, the LQFP64 is chemically decapsulated and the die is exposed while the part remains live, then a timed optical fault at the boot security check opens the port long enough to stream the array. The silicon package decapsulation page documents the opening, and the sibling STM32G474RCT6 data recovery ranks the same options for a nearby part. Microprobing is the fallback when the optical path is awkward.

A 10×10 mm LQFP64 carrying 512 KB has a small die inside a generous body, which is what makes the physical route practical. The compound is removed in controlled stages until the silicon face is exposed, the bond pads and lead frame stay intact, and the board is never desoldered. The customer gains a part that still runs while it is being read, so the fault can be aimed at a live boot sequence rather than at a dead device that only answers a debugger.

Surface Opens at RDP 1 Opens at RDP 2 Notes
SWD gate no no physical link only
Bootloader gate no no same decision
Glitch possible possible timing risk
Decap plus fault yes yes dependable

Recovering the program

Once any door opens the 512 KB dual-bank image is read twice and checksummed, with the 1 KB OTP and the option bytes taken alongside it. The HRTIM timing tables and the analog setup are captured as part of the program, not as an afterthought. Where the goal is a running copy, the verified set seeds a firmware clone following the STM32G473RET6 program break already in our catalogue.

Reading the array is only half of the job, because a 512 KB image from a G4 part is rarely a single program. It is usually a bootloader in one bank, an application in the other, and a set of calibration constants in the upper addresses. The recovery records which bank was live at the moment of capture, reconciles the two, and maps the constants, so the delivered file describes the product rather than just the bytes.

The verification step matters as much as the read. Both banks are read twice, the passes are compared, and the ECC on each cell is used to correct marginal bits rather than to silently copy them. A capture that closed mid-transfer is detected and repeated instead of being handed over as a short file. Where the aim is a working replacement, the same verified set drives a flash recovery and clone sequence on a fresh part.

What the client receives

The client receives the complete STM32G474RET6 program: the 512 KB binary image, the option bytes and OTP, a disassembly-based source reconstruction, and a verification report confirming the read.

Comments are closed.