PostHeaderIcon Retrieve Locked GD32F305RCT6 Flash: LQFP64 256 KB Read

The GD32F305RCT6 is the 256 KB flash member of the F305 line in an LQFP64 package, built on the same Cortex-M4 core at 120 MHz as the rest of the family but with enough room for an application, a USB stack and a boot stub together. When a unit arrives locked, the task is not to defeat a cipher but to retrieve the locked GD32F305RCT6 flash as a complete, faithful image. The data is not encrypted on the die; it is merely gated, and the difference decides the whole method. A gated array still holds every original word, which is why a careful read recovers it intact rather than producing a scrambled block that would need to be broken.

Microcontroller under recovery

What is actually inside the 256 KB

A recovered image of this part is three regions, not one blob. The lowest region is the user application. Above it sits any boot stub the firmware author left in, and at the very top of the array live the FMC option bytes that hold the SPC level itself. The ROM bootloader is not in this flash at all — it is a separate mask ROM — which is why the 256 KB you read back is entirely the customer’s code and data, nothing borrowed from the vendor. Knowing which bytes are code and which are configuration is the first step in turning a captured array into something usable.

Why a single read is never trusted

Flash read past a lock is done on a port that is only held open for a window, so the capture is broken into blocks. Each block is read, the read is repeated, and the two are checksummed before the next block is taken. A block that disagrees is re-read rather than accepted, because a single dropped word in a jump table is enough to make the whole image fail to run. The 256 KB size means the capture is longer than on the 128 KB part, but the verification discipline is identical; it just has to be applied more times, and on the LQFP64 body the part is straightforward to fixture so the longer capture costs time rather than difficulty. The full-image duplicate of the 1 MB VGT6 part is the same idea at larger scale.

The option bytes decide the clone

The most important few bytes in the image are the option bytes, because they carry the SPC level and the boot-mode settings. If those are captured together with the array, the image can be written to a blank RCT6 and the new part will boot exactly as the old one did, lock and all. If they are lost, the clone may run but will not carry the original protection state, which matters when the goal is a faithful copy rather than a stripped one. We return the option bytes explicitly so this decision stays with you.

Where this meets the F305 peripherals

Because the RCT6 carries the F305 USB OTG block, a useful image often contains a USB descriptor table and the enumeration code that goes with it. Recovering that region intact is what lets a clone enumerate on the same bus as the original, rather than booting blind. The methods for pulling those descriptors back out of a raw array are covered in our notes on decoding the protected binary of the larger RET6 part.

Reading it without destroying it

Everything above assumes the lock is at level 1, where the array is gated but the silicon is intact. The recovery is non-destructive: the RCT6 leaves the bench electrically identical to how it arrived, only now its 256 KB is in your possession. Where a part is instead at level 2 or has been physically protected, the route is no longer a read and becomes a decapsulation job instead, which is a different conversation.

Step Action Why it matters
1 Hold the port open past SPC Without this the read is refused
2 Read in checksummed blocks A dropped word breaks the boot
3 Capture option bytes A clone must carry the lock state
4 Verify vector table Confirms the image will run

How the image is handed back

The result is delivered as a binary file, the option bytes as a separate small block, and — where analysis is the goal — a disassembly. The smaller RBT6 part uses the same underlying lock, so the two articles together describe the whole LQFP64 sub-family.

Comments are closed.