Retrieve Locked GD32F303CBT6 Flash: LQFP48 128 KB Read
The GD32F303CBT6 doubles the smallest part’s memory: 128 KB of flash in the same LQFP48 footprint, still on the 120 MHz Cortex-M4. That second 64 KB is where the interesting code tends to live, which is exactly why owners lock it. When the read fails through every normal channel, the job is to retrieve the locked GD32F303CBT6 flash without a mass erase — and the first place people look, the system bootloader, is also the first place the chip says no.
The bootloader is not a back door
GigaDevice ships a bootloader in system memory that answers over USART and, on parts that include it, USB DFU. It can erase, program and read memory — but only while the security level permits. At SPC level 1 the read-memory command is explicitly rejected, and the bootloader will not hand over the main array no matter how the host frames the request. So a locked GD32F303CBT6 flash read cannot be coerced through the documented boot commands; the protection was designed precisely to stop that. The documented unlock path is equally useless here, because it erases the flash it is meant to free.
Where the 128 KB actually sits
The flash is a single contiguous array from 0x08000000, addressed linearly, with the option bytes living in a separate information block that the FMC guards. When the level-1 lock is active the entire 128 KB is hidden behind the same gate, not just a region. This is why partial reads and sector tricks fail: there is no open sector to start from. The recovery has to open the gate for the whole array at once, which is an attack on the check rather than on the storage, and it is the same early-boot fault injection used across the line. Our decapsulation notes cover the physical fallback when even that fails.
Paths that actually retrieve the image
Two routes reach the array on this part. The first is the same early-boot fault injection used on the smaller sibling: a glitch on the security-decision cycle opens the debug port long enough to pull the full image. The second, described in our power glitch notes, targets the supply during the FMC unlock so the array is presented to the bus before the lock re-asserts. Both preserve the 128 KB; neither performs the mass erase that would blank it. The choice between them comes down to how the specific unit behaves on the fixture, and we keep both ready so the part decides, not the method.
What the extra memory costs you
Doubling the flash does not change the lock, but it does change the capture. A 128 KB image takes longer to stream and is more exposed to a glitch that closes the port mid-read, so the read is verified in blocks and restarted from the last good sector rather than from zero. The table shows how the recovery decision scales with the protection level on this part.
| SPC level | Bootloader | Glitch read | Effort |
|---|---|---|---|
| 0 – open | direct | n/a | trivial |
| 1 – read lock | blocked | yes | moderate |
| 2 – chip lock | blocked | no | decap only |
Why a 128 KB part gets locked at all
The CBT6 is cheap and capable enough to end up in products where the firmware is the only thing of value: a sealed accessory, a locked peripheral, a controller whose maker has since disappeared. Locking it costs the owner nothing and costs a reader everything, which is the exact asymmetry that makes recovery worth doing. We see the same pattern on the smaller C8T6, and it explains why the protection is almost always level 1 rather than level 2. Most lockers want to stop casual copying, not a determined bench, so the read usually succeeds without destroying the part. Knowing the motive does not change the technique, but it tells you which path to try first and how likely the capture is to survive the attempt.
How the flash comes back
Once read, the 128 KB is verified against the option-byte block and delivered as a binary plus a map of where the boot and information regions sit. If the goal is to keep the unit alive, the image is placed into a blank restored flash and the option bytes are rewritten to level 0 so the clone behaves like an open part. This is how we retrieve locked GD32F303CBT6 flash without losing the code that made the original worth saving, and the same method feeds the binary decode step that follows extraction. The smaller part’s recovery is the same idea with less to capture.