Posts Tagged ‘break mcu encrypted firmware’
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.
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
- Power at the design rail, measured at the socket.
- Attempt serial programming. Note the exact failure mode — some programmers distinguish “no response” from “signature mismatch”.
- Measure the reset pin while the programmer asserts it. If it does not follow, a fuse reassigned it.
- Attempt the debug interface before reaching for the high-voltage adapter.
- 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
- ATtiny24 and high-voltage entry — what the twelve-volt path can reach.
- ATtiny44 and the debug interface — the same mechanism in more detail.
- ATtiny25V and what software protection means — the layer above the fuses.
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.
R7FA2L1A93CFN: Eight Kilobytes That Are Not EEPROM
Eight kilobytes of persistent storage is the kind of figure that makes an engineer think of one specific thing, and on most microcontrollers that thing is an EEPROM: byte addressable, byte writable, a hundred thousand cycles, no erase step.
This part does not have one. It has a second flash array, and calling it «data flash» is accurate in a way that the request «extract the EEPROM» is not. The difference is not terminology. It changes what the firmware must do, what can be lost, and how a recovery has to read it.
Two arrays behind one controller
The code flash and the data flash are separate address ranges served by the same programming interface. They are not the same array divided in two; they are distinct structures with distinct roles, and on this part the split is fixed at 128 KB or 256 KB of code and 8 KB of data depending on the ordering code.
| property | code flash | data flash |
|---|---|---|
| size on this part | 128 KB | 8 KB |
| address range | from zero | separate segment, 0x4010_0000 |
| read | memory-mapped | memory-mapped |
| program | by block | by block |
| erase before program | required | required |
| endurance class | flash | flash |
The third and fourth rows are the ones that separate this from an EEPROM. Reading either array is an ordinary load from an address. Writing either array is an operation with a command sequence, a block granularity and an erase step.
Why the EEPROM comparison fails
| behaviour | EEPROM | this data flash |
|---|---|---|
| write one byte | write one byte | read block, erase block, rewrite block |
| erase step required | no | yes |
| endurance | higher | lower, flash class |
| write time for one byte | fast | block erase plus block program |
| power loss during write | one byte at risk | the whole block at risk |
| access while writing | not possible | not possible |
The fifth row is the one with consequences for a recovery. A design that treats the data array as a settings page and rewrites one field when a user changes it is performing, underneath, an erase and a rewrite of an entire block. If the power fails during that operation, the block is not left with the old value and not left with the new one. It is left erased, or partly programmed, and everything that shared the block is gone.
That is why serious designs on this class of part do not write directly. They either keep a shadow copy in RAM and commit rarely, or they use a scheme that never overwrites the only copy of anything.
What the firmware does instead
Three patterns appear again and again, and recognising which one a product uses is one of the more useful outcomes of reading its image.
A rotating log. Records of fixed length written in sequence through the array, each with a sequence number or timestamp, wrapping to the start when the array is full. The newest record is authoritative. Power loss costs the record being written and nothing else.
Two-block ping-pong. Two blocks hold alternate copies. One is always complete. A commit writes the inactive block, verifies it, and then flips a pointer. Power loss costs one update, never the last good state.
A block-aligned settings image. The whole block is a structure with a header, a version, and a checksum. Every change rewrites it entirely. Simple, robust against corruption, and hard on endurance if changes are frequent.
| pattern | power-loss exposure | endurance cost | how it looks in the image |
|---|---|---|---|
| rotating log | one record | low, spread across the array | increasing sequence field |
| two-block ping-pong | one update | moderate, concentrated | two identical-size regions |
| settings image | one change | high if frequent | fixed header at block start |
Identifying the pattern from a dump takes minutes and answers a question customers ask constantly: what happens to my calibration if the unit loses power during a save.
Reading it, and why it is a separate file
The data array is memory-mapped at its own address, which makes reading it trivial and merging it into the code image wrong. The two arrays live at different addresses, are programmed by different commands, and are restored by different operations. A merged file cannot be written back correctly by anything.
The deliverable therefore has two files, and the report should state the base address of each. That single line prevents the most common downstream mistake, which is a customer’s programming fixture writing the data image at address zero.
What the data array usually holds
On a part this small the eight kilobytes are almost never a general-purpose store. They are one of a handful of things, and the contents are usually recognisable at a glance:
- a calibration set with a header and a checksum, occupying a fraction of the array;
- a usage log, regular in structure, with a monotonically increasing field;
- a serial number and a manufacturing record, written once at production;
- a copy of settings that also exist in flash, kept as a fallback.
The third item is worth looking for specifically. Where a serial number exists it is often the piece of information the customer actually needs, because it ties the unit to a production record, and it is not recoverable from anywhere else once the part is gone.
What the deliverable contains
The return set is the code flash image, the data flash as a separate file with its base address, the configuration words, the identification words as read, a disassembly with the vector table resolved, and a description of the persistence scheme found in the data array.
That description is the part of the report that changes customer behaviour. A customer who learns their product commits a whole block on every settings change will schedule the fix; one who already knew will nod and move on.
The half-capacity member of the same group is in R7FA2L1A93CFP binary recovery. The access window that may cover part of this array is in R7FA2L1AB2DFL flash recovery, and what heat does to everything stored in flash over years in R7FA2L1AB2DNE binary recovery.
FAQ
Is there an EEPROM on this part? No. There are two flash arrays. Persistent data lives in the smaller one.
Can the data array be written a byte at a time? Not at the hardware level. The operation is a block erase followed by a block program, whatever the software interface appears to offer.
Why deliver it as a separate file? Because it has a different base address and a different programming operation. A merged image cannot be restored correctly.
Conclusion
Eight kilobytes of persistent storage on a part with no EEPROM is a design constraint disguised as a feature. The array is flash: block erased, block programmed, and vulnerable to power loss across the whole block rather than one byte. Reading it is trivial and must produce its own file. What the firmware does to work around the constraint — log, ping-pong, or full rewrite — is visible in the dump and is usually what the customer needed to know.