Posts Tagged ‘възвръщам mcu data’

PostHeaderIcon Decode Locked GD32F330C6T6 Memory: LQFP48 32 KB Read

The GD32F330C6T6 is the mid-size LQFP48 member of the F330 line: a Cortex-M4 at 84 MHz with 32 KB of flash and 4 KB of SRAM and 39 GPIO, which is why it so often ends up as the main controller on boards that have outlived their documentation. Owners rarely want an abstract unlock — they want to know what is actually inside the chip. To decode locked GD32F330C6T6 memory is to read the array past its protection and then map it: where the program starts, where the data hides, and what the option bytes say about how the part was locked.

Decapsulated microcontroller die under recovery

Thirty-two kilobytes, fully mapped

The array occupies the address window starting at 0x08000000, and its first bytes are the vector table — the initial stack pointer and the reset handler that everything else hangs from. Reading a locked C6T6 without a map is how images get misinterpreted; reading it with one shows a structure: vectors at the bottom, then the compiled application, then constants and any data pages the firmware keeps in flash. The F330 has no separate EEPROM, so board-level data that must survive power cycles lives somewhere in these 32 KB, and finding it is part of the decode.

Where the lock sits

The protection is not inside that address window. It lives in the option bytes, a small separate region holding the security-protection level the flash controller evaluates on every reset. At level 1 the debug port and the USART bootloader both refuse the main array while the rest of the chip runs normally — the classic “healthy board, unreadable chip” combination. Level 2 seals the part for good. The scheme will be familiar from the lock bit protection used across the industry, and it is why an erase-based “unlock” is never used on a part whose contents matter.

Reading the array

Recovery starts with a timed fault on the boot-time security check, which leaves the port open and the array intact; the method is the one we apply across the family’s flash recovery work. The 32 KB then streams out in one session, captured twice and checksummed. The option bytes are read separately so the report can state the original lock level — information that matters if a replacement part is ever programmed to match.

Decoding the image

Region Typical contents What it answers
Vector table Stack pointer, reset and IRQ handlers Which peripherals are in use
Code section Compiled application Program logic and version strings
Constants Lookup tables, strings Calibration and product identity
Data pages Persisted settings What the board “remembers”

Once mapped, the image starts answering practical questions. Version strings date the firmware. Interrupt handler counts show which peripherals are active. Calibration tables explain why two nominally identical boards behave differently. This is the same decode logic we apply to the family’s larger arrays in the GD32F330K6U6 source code rebuilds.

Reading data pages safely

The flash-resident data on the C6T6 is read during the same capture as the code, which matters because pulling the data out through the running application is slow and risks the board. Reading the array directly captures the values exactly as stored, then decodes them in the lab where they can be checked against the code that uses them. Calibration tables, serialised configuration and any fault records come out together; nothing is inferred from a live read of a board that may not survive another power cycle. We present those pages separately from the code so the customer can review what the device remembers without wading through the application, and the two are cross-referenced where the firmware makes the link obvious.

What the decode is used for

Most C6T6 decodes feed one of three goals: documenting a firmware that will be maintained from now on, extracting specific values such as a calibration set, or preparing a verified image for duplication. The flow is shared with the 20-lead GD32F330F6P6TR and the fault-injection route detailed for the GD32F330C8T6, and where a full copy is the goal the image moves into our IC cloning service. Send the chip or the board — the decode report comes back with the map, the binary, and the option-byte state.