PostHeaderIcon ST72F321M9 Secured Microcontroller: Classify Before You Attack

Every ST72F321M9 secured microcontroller enquiry arrives with the same word and three different devices behind it. One is a part with no protection at all whose owner has confused “encrypted” with “hard”. One is a part with read protection that will yield to a die-level approach. One is a part with read and write protection, where the second lock changes what a successful read is even worth.

The plans differ in cost by an order of magnitude, and the information that selects between them is available before any irreversible step. That is the argument of this article: classification first, action second, and never the other way round.

The classification that decides everything

The states are defined by two independent settings, and the combinations produce three practical classes.

class read protection write protection what the owner can still do
open off off read, reprogram, and reuse the device
read-only locked on off nothing through the interface except erase
fully locked on on nothing, including erase by the normal route

The third row is the one that changes the arithmetic of a job. A device that can be erased can at least be reused, even at the cost of its contents. A device that cannot be erased is not reusable at all, so the only value it has is the value of its contents — which means the recovery is worth doing or the device is scrap.

How to tell them apart without writing anything

The probe sequence uses only operations that do not modify the device, in an order that produces a decision at each step.

First, does the device respond at all? If it does not, no classification is possible and the problem is power, clock or connection.

Second, does a read return plausible data? If the vector table at the top of the map returns addresses that land inside the application region, the device is open and the job is a plain read.

Third, if the read returns a uniform value, does the device accept a full-chip erase command? A device that accepts the erase is read-protected but not write-protected. A device that refuses both is fully locked.

step observation conclusion next step
1 no response not a protection issue check power, clock, connections
2 vector table is coherent class open read and deliver
3 uniform read, erase accepted read-protected choose: reuse or recover contents
4 uniform read, erase refused fully locked die-level route, or decline
5 read coherent but some blocks fail open with damage block-level re-read before deciding

Step three is where the sample is most often lost unnecessarily, because accepting the erase destroys the contents. A probe that performs the erase to see whether it is accepted has answered the classification question and destroyed the thing it was classifying.

The safe version of step three

The erase permission can be established without performing an erase, in most implementations, by observing how the device responds to the command rather than by letting it complete.

The signal is the acknowledgement that precedes execution. A device that is going to refuse generally refuses at the command stage; a device that is going to accept acknowledges and then begins. Cutting power immediately after the acknowledgement, before the erase has progressed, leaves the array intact in the common case — but this is a race, not a guarantee, and it should never be run on a customer’s only sample.

The reliable version is to run the classification on a sacrificial unit of the same part number. A production batch usually contains one, and the cost of destroying it is trivial compared with the cost of destroying the unit the customer actually cares about.

Why classification errors are expensive in both directions

Classifying an open device as locked spends money on a die-level procedure that was never needed. That error is common when the first read returns a uniform value because of a connection problem rather than protection — the tool reports FF and the report says “protected” when the truth is “the clip was not seated”.

Classifying a locked device as open is worse. It produces a plan that assumes a session will work, an attempt that fails, and often a device that has been through several failed attempts before anyone reconsiders. On a part with a limited number of programming cycles in its erase budget, repeated failed attempts consume a resource that cannot be restored.

error immediate consequence downstream consequence
open read as locked unnecessary die-level work cost, and a consumed sample
locked read as open failed sessions, repeated attempts erase budget consumed, suspicion of damage
read-protected read as fully locked proposal to open a device that could be erased customer pays for the wrong remedy
damaged read as protected wrong diagnosis the real fault is never found

The probe sequence, written down

A defensible probe has five steps and none of them write.

Confirm the device runs, in a board if one is available. Establish a session and read the first block, which on this family contains the low part of the application. Read the top block, which contains the vector table and the option bytes. Compare both against what an erased device would return. And record the results with the actual byte values, not just a verdict.

The last instruction is the one that makes the report useful. “The vector table read as FF at all sixteen entries and the option bytes read as FF FF” is evidence. “The device is protected” is a conclusion that a second engineer cannot check.

What each class implies for the service

Class open: a session read, delivered with the map and the block status. No sample consumed, turnaround measured in hours.

Read-protected: a choice between two services that are not the same service. Reuse — erase and reprogram — is cheap and destroys the contents. Contents recovery is the die-level route and consumes the sample. The customer picks, and the picking should be explicit in writing.

Fully locked: the die-level route or nothing. There is no reuse option, so the decision is purely about whether the contents are worth the cost.

Where the neighbouring arguments sit

The three read outcomes that a protected device can produce are analysed in ST72F32AK1 flash memory protection, which is the diagnostic layer beneath this classification. The trade-off the customer faces in the read-protected class is worked through in ST72F324BJ flash memory unlocking. And the single-bit nature of the lock, contrasted with multi-level protection on larger parts, is the subject of ST72F324J6 locked bit.

A classification that is written down, evidenced, and agreed before any action is what separates a controlled job from an experiment on someone else’s hardware. It is also the only part of the work that can be done without risk, which makes it the obvious place to start.

Comments are closed.