Bao'An Shenzhen China

GD32 Unlock Guide | How It Differs From STM32

Published · About 7 min read · PCB-Copy

On this page
  1. GD32 Unlock Guide: What Engineers Need to Know First
  2. How GD32 Read Protection Actually Works
  3. Where GD32 Diverges From STM32 in Practice
  4. Which GD32 Series Can Be Unlocked?
  5. Step-by-Step: What Authorized GD32 Firmware Recovery Looks Like
  6. Common Failure Modes and Honest Caveats
  7. Pricing Ranges for GD32 Unlock
  8. Related MCU Unlock Work
  9. Frequently Asked Questions

GD32 Unlock Guide: What Engineers Need to Know First

GD32 microcontrollers from GigaDevice are often marketed as STM32-compatible drop-ins, but their flash-protection mechanisms are not identical. This GD32 unlock guide covers the real differences in read-protection levels, SWD/JTAG lock behavior, and option-byte handling that determine whether authorized firmware recovery is feasible on a specific GD32 part. If you are recovering your own firmware from a locked GD32F103, GD32F303, or GD32E230, the details below will save you hours of guesswork.

How GD32 Read Protection Actually Works

gd32 unlock guide: GD32F103 microcontroller on a PCB with SWD debug header for firmware access

GigaDevice implements a Security Protection (SPC) scheme across most Cortex-M GD32 families. It mirrors STM32’s RDP concept but with important silicon-level differences:

  • SPC Level 0 (No protection): Flash is fully readable via SWD/JTAG and the GD-Link interface. No unlock needed.
  • SPC Level 1: Flash read-out is blocked through the debug port. Connecting via SWD returns 0xFF or triggers a bus fault. However, the MCU still boots normally from internal flash. Removing Level 1 via option bytes triggers a full flash erase — the same behavior as STM32 RDP1.
  • SPC Level 2 (where available): Debug port is permanently disabled at the hardware level. Option bytes cannot be written. On parts that implement true Level 2, this is irreversible through standard interfaces.

The critical nuance: not every GD32 series implements Level 2 identically to STM32. Some early GD32F103 revisions (mask revision A/B) had weaker enforcement of SPC Level 1 than their STM32F103 counterparts. Later silicon revisions closed those gaps. This means the specific die revision — not just the part number — determines recoverability.

Where GD32 Diverges From STM32 in Practice

Engineers who have worked with STM32 RDP often assume the same tooling and techniques apply 1:1 to GD32. They do not. Here is a concrete comparison:

Parameter STM32F1xx GD32F103 Impact on Unlock
Protection levels RDP 0 / 1 / 2 SPC 0 / 1 / 2 (varies by revision) Level 2 availability differs by lot
Option-byte base address 0x1FFF F800 0x1FFF F800 (same) Register-compatible, but timing differs
Flash page size 1 KB (≤128 KB) / 2 KB (>128 KB) 1 KB across all densities Erase granularity affects recovery strategy
Debug interface SWD + JTAG SWD + JTAG (GD-Link preferred) Some J-Link versions misidentify GD32
Flash controller registers FLASH_CR, FLASH_SR FMC_CTL, FMC_STAT (renamed, same offsets) Scripts need register-name adjustments
Bootloader ROM entry BOOT0 = 1, BOOT1 = 0 Same pin logic, but ROM version differs ISP commands may behave differently
Glitch susceptibility (Level 1) Varies by revision Early revisions more susceptible Feasibility is revision-dependent

The renamed flash-management controller registers (FMC vs FLASH) trip up OpenOCD scripts regularly. If you are using a custom unlock script written for STM32, expect to modify at least the register definitions and potentially the flash-wait-state timing. GD32 parts often run at 108 MHz stock (vs 72 MHz on STM32F103), and the flash access latency configuration reflects this.

Which GD32 Series Can Be Unlocked?

Feasibility depends on the protection level set and the specific family. Our engineers evaluate each case individually, but here is a general landscape:

GD32 Family Core SPC Level 1 Recovery SPC Level 2 Recovery Typical Turnaround
GD32F103 Cortex-M3 High (most revisions) Low to none 5–10 working days
GD32F303 Cortex-M4 Moderate to high Very low 7–12 working days
GD32E230 Cortex-M23 Moderate Not applicable (no true L2) 5–8 working days
GD32F350 Cortex-M4 Moderate Low 7–12 working days
GD32VF103 RISC-V Case-by-case N/A 10–15 working days

The RISC-V–based GD32VF103 uses a different debug transport (JTAG via the Nuclei RISC-V debug spec, not ARM CoreSight). Standard ARM-focused unlock approaches do not apply; this family requires specialized tooling and is evaluated on a per-case basis.

Step-by-Step: What Authorized GD32 Firmware Recovery Looks Like

1. Identify the Exact Part and Revision

Read the full marking: e.g., GD32F103RCT6. Then check the lot code and, if possible, the die revision via the DBGMCU_ID register (0xE004 2000). Revision determines which protection weaknesses, if any, exist.

2. Determine the Protection Level

Connect via SWD using OpenOCD or GD-Link. Attempt to read the option bytes at 0x1FFF F800. If SPC is Level 0, the value at offset 0x00 reads 0xA5. If Level 1, you will typically see 0x00 or get a read error. Level 2 blocks even option-byte access on most revisions.

3. Provide Proof of Ownership

Before any extraction work begins, we require documentation proving you own the design or have authorization from the IP holder. This is non-negotiable — learn more about the legal framework for IC unlock and the jobs we decline.

4. Feasibility Assessment

We evaluate the specific silicon revision, protection level, and flash size. Not every GD32 at SPC Level 1 is recoverable — newer revisions with patched boot ROMs may resist techniques that work on older lots. We provide a clear go/no-go within 2–3 working days of receiving the sample.

5. Extraction and Verification

If feasible, firmware is read out and verified against a CRC or known-good behavioral test. The binary is delivered as a .bin or .hex file. On GD32F103 parts with 256 KB–512 KB flash, extraction typically takes 1–3 hours of active lab time once the protection is bypassed; the elapsed turnaround includes queue time and verification.

Common Failure Modes and Honest Caveats

Debug probe connected to a development board during MCU firmware extraction

No responsible GD32 unlock guide should skip the failure scenarios:

  • Misidentified part: Some GD32F103 boards are populated with remarked STM32F103 (or vice versa). The DBGMCU_ID register is the only reliable way to confirm the silicon vendor. GD32 returns 0x0000 1303 for GD32F103; STM32 returns 0x2001 0410 or similar.
  • Flash corruption during extraction: Voltage-glitch approaches carry a small but nonzero risk (~2–5% in our experience on GD32F1 series) of partial flash corruption. We mitigate this by attempting non-destructive reads first and maintaining a rollback path where possible.
  • Level 2 on late-revision parts: If the device is confirmed SPC Level 2 on a 2022+ revision GD32F303, recovery through non-invasive methods is essentially zero. Invasive (decap + microprobing) is technically possible but cost-prohibitive for most projects — typically $8,000–$15,000+.
  • RISC-V GD32VF103: The Nuclei debug spec is less publicly documented than ARM CoreSight. Tooling is still maturing. Success rates are lower, and turnaround is longer.

Pricing Ranges for GD32 Unlock

Costs depend on the family, protection level, and flash density. These are starting-point ranges, not fixed quotes:

Scenario Typical Cost Range (USD) Notes
GD32F103, SPC Level 1, ≤128 KB $300–$600 Most common request
GD32F303, SPC Level 1, 256 KB $500–$900 Higher complexity, longer verification
GD32E230, SPC Level 1 $350–$700 Cortex-M23 TrustZone considerations
GD32VF103 (RISC-V) $800–$1,500+ Specialized tooling required
Any GD32, SPC Level 2 (invasive) $8,000+ Decap/microprobe; not always feasible

A free feasibility check is available before any paid work begins.

Check feasibility for your project

Send the chip marking or board details and tell us what you need to recover. Add clear photos if available.

Request a feasibility review

Related MCU Unlock Work

If your project involves mixed BOM with multiple locked controllers, our lab handles a wide range of families alongside GD32. Engineers working on Nuvoton-based boards may find our NUC131 unlock feasibility breakdown relevant. For designs pairing a GD32 with external EEPROM storage, we also recover data from locked serial EEPROMs — see our notes on 24C64 EEPROM readout and W25Q64 SPI flash extraction. Nordic BLE SoCs on the same board are covered under our nRF52832 unlock process.

Frequently Asked Questions

Can I use STM32CubeProgrammer to unlock a GD32?

STM32CubeProgrammer will often connect to GD32F103 and GD32F303 parts because they share a compatible SWD interface and similar flash register offsets. However, it cannot bypass SPC Level 1 protection — it can only remove Level 1 by erasing all flash. For non-destructive firmware recovery, specialized tooling and techniques are required beyond what any standard programmer offers.

Is GD32 unlock legal?

Recovering firmware from a GD32 you designed or legally own is lawful in most jurisdictions under repair, interoperability, and IP-recovery provisions. We require proof of ownership or written authorization before starting any work. We decline projects where the requester cannot demonstrate a legitimate right to the firmware. Read our full legal and ethical framework for IC unlock.

Does removing SPC Level 1 on GD32 erase the flash?

Yes. If you clear the SPC Level 1 option byte through the standard interface (GD-Link, OpenOCD, or ISP), the GD32 flash controller performs a mass erase before dropping to Level 0. This is by design and matches STM32 RDP1 behavior. Non-destructive recovery requires bypassing the readout protection without triggering the erase sequence — which is what our lab specializes in.

How do I tell if my chip is GD32 or STM32?

Read the DBGMCU_IDCODE register at 0xE004 2000 via SWD. GD32F103 returns a device ID of 0x1303; STM32F103 returns 0x0410 (medium-density) or 0x0414 (high-density). Physical markings can be unreliable due to remarking. The register value is definitive.

What if my GD32 is at SPC Level 2?

True SPC Level 2 disables the debug port permanently at the fuse level. Non-invasive recovery is not feasible on confirmed Level 2 parts from recent silicon revisions. Invasive methods (decapsulation and microprobing) are technically possible but start at $8,000+ and carry risk of die damage. We provide an honest feasibility assessment before you commit any budget.

Check feasibility for your project

Send the chip marking or board details and tell us what you need to recover. Add clear photos if available.

Request a feasibility review
TURN THE GUIDE INTO A PROJECT QUESTION

What do you need to recover?

Send the full marking or board photos, sample condition and required outcome. Ask for an NDA before sharing confidential files. Scope and sample handling are confirmed individually.

The article title is carried into the contact form. Add your own details and review the enquiry before sending.

WhatsApp Send board details