Break Encrypted STM32G030J6M6 Source Code: SO-8 32 KB Recovery
The eight-pin STM32G030J6M6 is the G0 value line squeezed into an SO-8 body, an Arm Cortex-M0+ at 64 MHz with 32 KB of flash and 8 KB of SRAM. It exists to be a cheap glue MCU: a handful of usable GPIOs beyond power, reset, boot and the SWD pins. When one of these is locked and the design is lost, the goal is not just to copy it but to break encrypted STM32G030J6M6 source code back into something an engineer can read and rebuild.
The eight-pin body as a glue part
Because the STM32G030J6M6 devotes most of its eight pins to power, reset, boot and debug, the application logic has to fit in very few lines, which makes it a favourite for sequencing, bridging or simple sensing where a larger part would be wasted. Recovery is intimate too: the board has no room for a second memory device, so the part is the entire program store. Our flash recovery work often starts with such a single-chip design.
No USB, so no DFU side door
The G0 family has no USB peripheral, and the STM32G030J6M6 is no exception, so there is no DFU boot path at all. What remains is the ROM bootloader over USART and the SWD debug port, both governed by the same readout protection in the option bytes. Level 1 blocks reads of main flash from either interface; level 2 seals the part. The lock-bit model is the one we describe for AVR parts in our lock-bit primer, with the same caution: stepping back to level 0 erases the 32 KB you wanted.
Opening and reading the SO-8
The SO-8 is a small but flat body, and the die sits centred with margin for a chemical etch that exposes the full face while the part stays electrically live. With the silicon open, an optical fault timed at the boot security check can hold the debug port open long enough to stream the array out, or microprobing takes over where the fault window is awkward. The small array makes the STM32G030J6M6 a fast capture once the port holds. The decapsulation service we run handles this body alongside the larger STM32G030C6T6.
An eight-lead package is comfortable to work on because there is almost nothing around the part to foul, and the wide gull-wing leads leave the bond pads visible once the compound is gone. Keeping the board live matters for a specific reason: on a glue MCU the firmware starts its real work within a few hundred microseconds of reset, so the security check is passed almost immediately and the timing window for a fault is short.
Where the package route is not warranted, a supply or clock perturbation can widen the same comparison window without opening anything. Our power glitch and clock glitch notes cover those attempts, and they carry no risk to the image because a failed attempt simply leaves the part locked.
From image to reconstructable source
| Stage | Input | Output |
|---|---|---|
| Capture | live die | raw 32 KB image |
| Lift | image | disassembly listing |
| Reconstruct | listing | commented source |
| Verify | source build | matches original |
A raw image is not yet source. After the 32 KB is captured we lift it into a disassembly, then reconstruct commented source against the known G0 peripheral map so the registers and vectors read as intent rather than noise. The reconstruction begins with the vector table, because on a part this small the interrupt list is the clearest description of what the firmware does. Each handler is separated using the call graph, and the peripheral register footprint identifies routines touching the two ADCs or the USART.
The second half of the job is the timing. A glue MCU like this often runs a state machine whose only interesting content is in the delays it inserts between actions, and those delays live as literal values rather than as named constants. Recovering them as readable values turns a listing into a document an engineer can edit and re-time, which is usually why the customer wanted source rather than the binary. Where power or clock glitching is the cleaner route, our power glitch and clock glitch notes cover the alternative attacks. The neighbouring STM32G030F6P6 flash read uses the same recovery first.
What you receive from a broken lock
You receive the complete 32 KB binary, the option bytes showing the original lock state, and a disassembly-based source reconstruction where the aim was to understand rather than merely copy. A verification report accompanies the files, confirming both read passes matched. Where the goal is a working replacement, the same verified image is written to a blank part through our firmware cloning process, and the STM32G030K6T6 memory decode follows the same pipeline in a 32-lead body.