Copy Locked GD32F303RE Firmware Image

The practical goal behind every request to copy locked GD32F303RE firmware image data is continuity: a 512 KB, 64 KB-SRAM Cortex-M4 controller running at 120 MHz, in a 64-pin package, holding firmware nobody can rebuild because the source left with a former employee. Copying that image is not one operation but a chain — establish the protection state, choose a non-destructive readout route, capture the array completely, and only then talk about programming the result onto new silicon. Skipping a link in that chain is how fleets end up with clones that boot but misbehave.

What the lock actually blocks

The RE carries the family-standard protection: the SPC byte in the option byte area at 0x1FFFF800 decides between an open array and a protected one, and under protection the debug port, SRAM boot and system bootloader all lose read access to the main flash, with reads terminating in a bus error that is trivially recognizable once you have seen it. User code keeps full access to its own memory, which is why a resident bootloader or an update routine is always worth examining before anything invasive is considered. The option bytes remain readable in every state, and rewriting the SPC byte back to 0xA5 — the family’s open value — makes the controller erase the entire array on the spot. Copy and unlock are therefore different projects on this part, and we price them as such.

Reading a 512 KB array completely

At 512 KB the RE still sits inside bank 0, organised in 2 KB pages, so a complete capture is 256 pages plus the option byte block, each region checksummed as it is read. The zero-wait-state flash keeps readout quick, but speed is not the metric that matters; completeness is. The electronic signature area is read alongside the array so the recovered image is tied to the exact die it came from, and the result is delivered as a heximal with the boot section, application and constants labelled separately. Engineers who need the neighbouring capacities compared will find the program-memory dump notes for the 256 KB RC and the equivalent work on other 512 KB-class parts useful background.

From there, copying onto a blank device follows the copying discipline applied to smaller AVR images: sector boundaries preserved, option bytes reproduced or deliberately relaxed, functional verification on the customer’s board before the fleet is programmed. The restoration workflow covers marginal or damaged donors, and the protection-design review is worth an hour before replacement units are locked for a second time.

Option bytes as a deliverable, not a detail

On every project of this kind there is a moment when the customer asks what to do about the lock on the replacement devices, and the honest answer depends on data most extractors throw away. The option byte block — SPC, its complement, the user byte and the write-protect words — is read at the start of every session anyway, because the protection state governs the method; delivering it as a structured record costs nothing and informs the one decision the customer actually owns. Reproduce the original configuration and the new fleet is exactly as tamper-resistant and exactly as unrecoverable as the old one; relax the SPC byte and the fleet becomes serviceable at the price of copyability; relax only the write-protect words and the array stays read-protected while accepting field updates, which is the middle road many maintenance teams actually want. We present the three options with their consequences, apply the customer’s choice, and record it in the report, because a clone fleet whose lock state differs silently from its documentation is a support ticket factory. On the RE, with 512 KB of application code and a real maintenance story behind it, the decision usually deserves five minutes of conversation rather than a default. In practice the choice takes one email: we send the three configurations with their consequences, the customer picks one, and the replacement fleet ships with a lock state that matches its paperwork. Nothing about that exchange is technically difficult; it simply has to happen before programming, not after.

Start the enquiry with what you know about the original programming — who programmed it, when, and whether any unit shipped unprotected. Those three facts decide whether this is a week’s work or an afternoon’s.