Clone Secured STM32G474QCT6 Software: LQFP128 256 KB Copy
The STM32G474QCT6 is the 128-lead member of the G4 digital-power line, packing a Cortex-M4 with FPU and DSP at 170 MHz, 256 KB of dual-bank flash and 96 KB of SRAM into a 14×14 mm LQFP128 body that also exposes an FSMC parallel bus and a Quad-SPI interface. Boards around this part rarely keep the firmware in the MCU alone, so to clone secured STM32G474QCT6 software you have to account for the external memories the controller talks to as well as the internal array. Leaving those secondary dumps out is the usual reason a recovered copy fails to run.
What the 128-lead body exposes
The LQFP128 gives the STM32G474QCT6 more than just pin count. It routes the Flexible Static Memory Controller, which can drive NAND, SRAM and parallel NOR devices, and it brings out Quad-SPI for serial flash and PSRAM. A clone that only reads the internal 256 KB therefore misses the code and calibration data living on those buses. The HRTIM high-resolution timer with 184 ps resolution and 12 channels also keeps its timing tables close to the application, so a faithful copy reconstructs the full memory map the software expects at boot.
Where the protection lives
The readout protection on the STM32G474QCT6 lives in the option bytes, not in the application image. Level 0 leaves the part open, level 1 blocks the SWD debug port and the system bootloader from reading the main flash, and level 2 seals the device permanently. Almost every secured field unit we receive sits at level 1, which is recoverable. The trap is the mass-erase advice: regressing level 1 to 0 triggers a full wipe of the flash, so the unlock must never become the goal. Our notes on AVR lock bit protection describe the same principle, and it shapes our flash recovery workflow.
Reading the internal and external arrays
With the SWD and bootloader doors shut, the dual-bank flash with ECC still holds the 256 KB image plus the 1 KB OTP area and the option bytes that record the original lock state. The FSMC and Quad-SPI targets are captured over their own buses while the part runs, because once the internal image is out the external devices can be read in a known-good session. The G4 also offers a securable memory area and PCROP blocks, and each of those boundaries is mapped so the clone reproduces the protected regions exactly as the original enforced them.
The external targets are captured twice and the two reads compared, so a byte that changed between sessions is flagged rather than copied into the clone. The boot-time check on this part is timed to run before the application touches any peripheral, which is why a fault aimed at that window can hold the port open while the external buses are still idle and their contents stable. The delivered set records which addresses came from the internal array and which came from each external device, so a mismatch on a later re-read can be traced to the right source.
When the electrical route closes
When level 2 is suspected, or when PCROP and write protection combine to block every software path, the package becomes the way in. Chemical decapsulation opens the LQFP128 moulding compound and exposes the die while the part stays electrically live, after which a precisely timed optical fault at the security check during boot can make the verification fall through and leave the port open long enough to stream everything out. The same silicon package decapsulation route applies to the sibling STM32G474QET6 and the STM32G474RBT6 covered in this batch.
| Region | Read at RDP 1 | Read after decap | In the clone |
|---|---|---|---|
| Main flash 256 KB | no | yes | yes |
| FSMC external | app-gated | app-gated | captured live |
| Quad-SPI device | app-gated | app-gated | captured live |
| Option bytes + OTP | read-only | yes | yes |
Stitching the copy
A clone is only useful if it boots, so the internal image and the external dumps are re-assembled against the memory map the software assumes. The 96 KB SRAM and 32 KB CCM SRAM are not copied, but their initialisation tables are, and the CORDIC and FMAC math accelerators are restored by the same constants. Where the objective is a working replacement rather than analysis, the verified set is written to a blank device using our firmware clone process, and the parallel STM32G473RBT6 file work follows the same discipline.
What the client receives
The deliverable is the complete flash binary image of the STM32G474QCT6 together with the external memory dumps, the option bytes showing the as-received lock state, a disassembly used for source reconstruction, and a verification report confirming the captured set runs. The part is returned in a sealed carrier so the open package is not disturbed in transit.