Posts Tagged ‘break mcu encrypted binary’

PostHeaderIcon Decapsulate Encrypted NRF52833-QIAA-R7 Memory: aQFN73 512 KB Read

The NRF52833-QIAA-R7 carries the full nRF52833 multiprotocol radio in the family’s largest package, a 7 x 7 mm aQFN73 that breaks out 42 GPIO around a 512 KB flash and 128 KB RAM core running an Arm Cortex-M4 with FPU at 64 MHz, and the R7 suffix only names the 7-inch reel it ships on. When the debug port is sealed by APPROTECT and the SoftDevice region is delivered encrypted, the honest path to decapsulate encrypted NRF52833-QIAA-R7 memory is to go past the package rather than past the lock, exposing the silicon while the part stays alive and reading the array straight off the die.

The reel code and the body it rides in

Nordic packs this variant on a 7-inch reel, the R7 container, so a board built around the NRF52833-QIAA-R7 can be sourced in the same small-reel format as its R and T siblings without any change to the die. The silicon, the 512 KB flash, the 128 KB RAM, the package and the temperature rating are identical across those containers, so the recovery work does not depend on which reel the part came from. What changes the job is the aQFN73 outline itself, because a 7 x 7 mm body leaves a generous margin of mould compound around a die that is much smaller, and that margin is what makes a controlled etch practical here.

What the die actually holds

Under the lid the core is an Arm Cortex-M4 with FPU at 64 MHz, scoring 217 EEMBC CoreMark from flash and 52 uA per megahertz from flash or 38 uA from RAM. The radio covers Bluetooth 5.1, mesh, Thread, Zigbee, NFC and proprietary 2.4 GHz, with transmit power programmable from +8 dBm down to -20 dBm in 4 dB steps and receive sensitivity of -103 dBm at 125 kbps long range, -96 dBm at 1 Mbps. There is a full-speed USB 2.0 controller, five 32-bit timers, three 24-bit real-time counters, four PWM units with EasyDMA, a 12-bit 200 ksps ADC and the programmable peripheral interconnect. Recovering memory from a part this capable means accounting for all of it, not just the application flash.

Why decapsulation beats the register route

The debug access port is closed by APPROTECT in the User Information Configuration Registers, and Nordic keeps a control access port, CTRL-AP, available so the device can be mass-erased but not read. Attacks that try to slip the lock through a supply glitch during boot depend on a timing window, and on revisions with the improved two-step APPROTECT they grow harder. Etching the package away and addressing the array on the exposed die avoids that fight entirely, because the protection state lives in the debug logic and the array itself answers once it is reached directly. Our notes on package decapsulation set out the sequence, and the dual probe and flying probe work applies once the pads are bare.

Opening the 7 x 7 mm aQFN73

The etch proceeds in controlled passes under the microscope while the board keeps running, because a live NRF52833-QIAA-R7 is worth more than a dead one when the aim is to read what it holds. The exposed thermal pad and the perimeter pads surface as the compound recedes, and the read then moves onto the die itself. The pass takes the 512 KB array twice and compares the two, so a cell that decodes differently between captures is caught and the image is confirmed clean before anything downstream begins. A careful read also keeps the UICR, which records the APPROTECT state, the customer data area, the pin-reset configuration and the NFC pin setup.

What the encrypted region means

One part of the image cannot be turned into plaintext no matter how the die is reached. The SoftDevice Bluetooth stack area is delivered encrypted and is decrypted into RAM only at boot, so a direct die read of that flash region returns ciphertext rather than code. That region is recorded honestly rather than hidden, because the bounds have to be stated for the next engineer who opens the file.

Region Read from the die Reported as
Application flash yes plaintext image
UICR and pin setup yes documented state
SoftDevice stack yes encrypted cipher

The flash recovery pass and the QDAA-R7 source rebuild both treat that region as out of reach, so the cipher is marked and the rest of the array is delivered whole.

What you get back

You receive the full 512 KB memory image of the NRF52833-QIAA-R7 with the SoftDevice region marked as encrypted, the UICR contents showing the original protection and configuration state, a disassembly-based reconstruction of the application code, and a verification report recording how the die was reached and how the read was checked. The same bench handles the QIAA-R flash attack on the smaller package and the WLCSP data read, while the same technique covers the STM32G474 program on other silicon.

PostHeaderIcon ATtiny24V: The Debug Fuse That Also Takes the Reset Pin

On a small AVR, the reset pin is a shared resource. It is the serial programming entry, it is the debug interface’s communication line, and it can be turned into an ordinary I/O pin. Three functions, one pin, and two fuses that decide which one wins.

The result is a family of failure modes that all look the same from the programmer’s socket: no device detected. Telling them apart is a matter of reading one byte, and reading that byte requires access — which is the circularity that makes this worth understanding before a part arrives.

The two fuses

Reset disable. The pin becomes a general-purpose I/O. Serial programming cannot be entered because there is no reset signal to assert. The debug interface cannot be entered either.

Debug wire enable. The pin is handed to the on-chip debug system. Serial programming cannot be entered, because the debug system owns the line. But the debug interface itself is available, and through it the fuse can be cleared.

That difference is decisive. One is recoverable over a wire you already have; the other needs twelve volts and a different adapter.

Fuse state Serial programming Debug interface Recovery path
Both clear available not available none needed
Debug enabled blocked available clear the fuse over the debug interface
Reset disabled blocked blocked high-voltage entry only

The middle row is the interesting one, and it is the one people miss. A part with the debug fuse set is not inaccessible — it is accessible through a different protocol, using the same pin.

Why the debug fuse gets set

Two reasons, both mundane. A developer debugging a prototype enables it and forgets to clear it before the build goes to production. Or a product uses the debug interface in the field for diagnostics, which is unusual but not unheard of.

Either way, the fuse is set for engineering convenience, not for protection. It is not a security feature, and treating it as one overstates what it does — the debug interface is a full read and write path for anyone with the right adapter.

What the debug fuse actually gives away

When the debug interface is available and the lock bits are clear, it offers something a static read does not: the ability to halt the core and inspect registers and memory while the firmware runs. On a part with fourteen pins and one timer, that is often more informative than a dump, because it shows the code’s interaction with the outside world rather than its text.

When the lock bits are set, the debug access is removed along with everything else. The fuse enables the interface; the lock bits determine what the interface may do.

That two-layer arrangement is worth keeping straight: fuse = which door, lock bits = what is behind it.

The V suffix and the read

The low-voltage grade extends the operating range downward. It does not change the fuses, the lock bits, or the interface protocols. What it changes is margin.

On a small part running from an untrimmed internal oscillator at the bottom of its range, the interface answers slowly, and a programmer set for speed will produce intermittent failures that look like a bad chip. Lowering the clock rate on the programmer is the fix, and it costs seconds.

The same caution applies to the high-voltage path. The twelve-volt pulse has to be delivered cleanly; a clip lead with poor contact will produce a failure that reads as a dead die.

Establishing which case you have

  1. Power at the design rail, measured at the socket.
  2. Attempt serial programming. Note the exact failure mode — some programmers distinguish “no response” from “signature mismatch”.
  3. Measure the reset pin while the programmer asserts it. If it does not follow, a fuse reassigned it.
  4. Attempt the debug interface before reaching for the high-voltage adapter.
  5. Only if both fail, use high-voltage entry to read the fuse byte and restore it.

Step 4 is the one that saves an adapter and a socket. A debug probe is a smaller commitment than a twelve-volt programmer, and on this family it is frequently the correct answer.

Why the fuse byte is the record

Whatever path gets you in, read the fuse byte and write it down. It explains the access problem, it predicts whether the same part will be reachable after reprogramming, and it is the only evidence of how the device was built.

A device whose fuses say “debug enabled” was built by someone iterating; a device whose fuses say “reset disabled” was built to save a pin; a device whose fuses say both was built by someone who did not check. Each of those is a different story about the product, and all three are visible in one byte.

Related notes

FAQ

Can the debug fuse be cleared over serial programming? No. Serial programming is what the fuse disables. It must be cleared over the debug interface or by high-voltage entry.

Does the debug fuse affect the lock bits? No. They are separate fields with separate effects. The fuse selects the interface; the lock bits govern what it may read.

Is a part with the debug fuse set insecure? It is accessible through a documented interface. Whether that is a security problem depends entirely on the lock bits.

Will high-voltage entry always work? It works on a healthy die regardless of fuses. It does not work on a damaged one, and it does not bypass lock mode 2.

Conclusion

Two fuses, one pin, three failure modes that present identically. The distinguishing evidence is the reset pin’s behaviour and the fuse byte, and the cheapest recovery path is usually the debug interface rather than the high-voltage adapter. Naming the case before acting is what keeps a small AVR from being written off as dead.