Decode Locked STM32G030K6T6 Memory: LQFP32 32 KB Read
The STM32G030K6T6 fills the middle of the G0 value line in a 32-lead LQFP32 body: an Arm Cortex-M0+ at 64 MHz with 32 KB of flash and 8 KB of SRAM, more pins than the TSSOP20 but fewer than the LQFP48. That footprint is common on control boards needing a few more peripherals without a bigger package, and it ships with read protection enabled and no archive kept. To decode locked STM32G030K6T6 memory you have to account for both the readout protection and the write protection, because they decide what the bootloader gives up.
The middle footprint and what it exposes
The LQFP32 carries the SWD debug pair, the USART bootloader pins and a reasonable set of GPIO, so the part looks reachable. The debug port links at the physical layer and then refuses the flash window, because the flash controller enforces the lock, not the wiring. There is no USB on the STM32G030K6T6, so no DFU entrance. Pin count changes nothing about the lock, which is why our flash protection methods notes treat the G0 family as one consistent scheme.
Option bytes and write protection together
The readout protection on the STM32G030K6T6 is only half of the option-byte story. The same bytes hold write-protection sectors that stop regions of flash being altered, and a decoded map has to record both. Reducing level 1 to level 0 triggers a mass erase, so the image is never traded for the unlock. Our lock-bit primer describes the same AVR fuse model, and our flash recovery never relies on a software unlock.
The USART bootloader decision
Because the system bootloader is ROM, it honours the RDP level before any user code runs, and on the STM32G030K6T6 the read-memory command declines where SWD does. Two interfaces, one verdict, so programmers get only error codes from a healthy, locked part. When the electrical route is closed we open the LQFP32 by chemical etch, keep the die live, and use an optical fault at the boot security check to hold the port open for the capture. The decapsulation service handles this body as readily as the STM32G030C6T6.
An LQFP32 at 7×7 mm leaves the die centred inside a generous body, so the compound can be taken back to the silicon without cutting between leads. The part stays soldered and powered throughout, which allows the fault to be aimed at a live boot sequence rather than a device that only answers a debugger. The security check is evaluated in the first instants after reset, so the fault has to land inside that window.
Where the sample resists the optical route, the bus can be probed directly. A perturbation of the supply or the clock can widen the comparison window without opening the package, and because a failed attempt leaves the part locked rather than damaging it, those are tried first whenever the leads are accessible. Our power glitch and clock glitch notes cover both.
What the protection state allows
| State | RDP level | WRP set | Readable path |
|---|---|---|---|
| Open | 0 | no | direct SWD |
| Locked | 1 | maybe | decap plus fault |
| Sealed | 2 | yes | probing only |
Reconstructing the decoded memory
After the 32 KB array is streamed out we lift it into a disassembly and map it against the G0 peripheral table, so vectors and registers read as structure rather than raw bytes. The vector table comes first, because on a 32 KB part the interrupt list is the clearest description of what the firmware does, and routines are separated using the call graph and literal pools. Peripheral registers sit at fixed addresses, so routines touching the two ADCs, the USART or the timers are identified by register footprint rather than by name.
The write-protection map matters as much as the code. A region that cannot be written on the original will also refuse a programming attempt on the replacement, a confusing failure if the map is not delivered. Recording which sectors were locked turns the recovery from a raw dump into something reproducible. Where power or clock glitching is the cleaner attack, our power glitch and clock glitch notes describe the timing windows. The neighbouring STM32G030C8T6 program clone follows the same decode.
What the decoded result contains
You receive the complete 32 KB binary, the option-byte record covering both RDP and write protection, and a verification report confirming both read passes matched. A disassembly-based source reconstruction is included where understanding the logic was the aim. Where the goal is reproduction, the verified image is written to a blank part through our firmware cloning process, and the STM32G030K8T6 binary duplicate carries the same discipline into the 64 KB density.