TMS320LF2402AP: A Blank Password Is Still a Password
There is a persistent misunderstanding about how these devices lock. The lock is not a fuse that is blown once and can never be undone, and it is not a bit that somebody sets in a configuration register. It is eight words stored in the flash array, compared against eight words supplied by whoever is trying to open the module.
That design has a consequence which surprises people on their first encounter: a device whose password area was never programmed is not unlocked. It is locked with a password of eight all-ones words, and anyone who knows the convention can open it in one attempt.
Why the password lives in the array
The choice to store the password in flash rather than in a separate one-time-programmable structure is a manufacturing decision. It lets the same silicon ship with different passwords per customer, and it lets a blank device be a blank device — no configuration step is needed before the part can be used.
It also means the password is subject to everything else that happens to flash: it can be erased by a mass erase, it can be partially written if power fails mid-programming, and its value is only as good as the convention the production line followed.
| Password state | What it means | Practical effect |
|---|---|---|
| All ones, never programmed | Blank flash words | Module opens with the conventional all-ones sequence |
| Constant derived from a part number | Typical production shortcut | Recoverable by deriving the convention |
| Pattern derived from a serial number | Slightly better practice | Recoverable per unit if the rule is known |
| Random per unit, stored externally | Genuine protection | Not recoverable by search |
| Partially written | Interrupted programming | Behaves like an unknown password |
The measurement that comes first
Before any unlocking attempt, establish which row of the table above applies. This is not a guess; it is a measurement, and it takes one session.
The procedure is a small bounded search over the plausible conventions rather than a blind search over the keyspace. The keyspace is far too large to enumerate, but the set of conventions actually used in production is small: all ones, all zeros, a repeated part number, a repeated date code, a value copied from the vector table, or a value derived from a serial number by one of a handful of arithmetic rules.
A bounded search over that list either succeeds in minutes or fails in minutes. Either outcome is useful, because failure tells you that the password is not conventional and the project moves to a different category.
The all-ones case in more detail
The all-ones case is worth spelling out because it produces a confusing symptom. The device reports itself as secured, the debugger cannot read the array, and the natural conclusion is that the password is set. In fact the module is behaving exactly as specified: it is locked, and the password happens to be the value that blank flash reads as.
Nothing about the device distinguishes this from a set password except the result of supplying the all-ones sequence. The check is one transaction and should always be the first one attempted.
What unlocking actually does
When the eight words match, the module becomes unsecured for the current session. From that point reads of the protected array return real data rather than zeros, and the array can be copied by ordinary means.
Two details matter for the rest of the job:
- The unsecure state does not persist across a reset. Power-cycling the device returns it to the locked state, and the sequence has to be repeated.
- Unsecuring does not remove the password. The eight words are still in flash and still required next time.
That first point shapes the extraction routine. The routine cannot unlock the device once and then take its time. It has to unlock, perform the transfer, and be prepared to re-unlock if the device resets mid-transfer — which it will if the transfer disturbs the watchdog or the clock configuration.
Zero reads and what they mean
A read from a protected address returns zeros. This is easy to misread as an erased region or a failed connection, and both misreadings waste time.
The distinction is reliable: an erased region reads as ones, a protected region reads as zeros, and a failed connection returns either an error or a value that does not repeat between two identical reads. Performing the same read three times and comparing is enough to separate the three cases before drawing any conclusion.
What to do when the password is not conventional
At that point the search space is exhausted and the honest options are two. Password recovery stops being a search and becomes analysis of the specific product, which is only worth attempting when there is a reason to believe the password is derivable at all. Physical work bypasses the question entirely by reading the array through a different route, at a cost that has nothing to do with the password.
Choosing between them depends on quantities the customer usually knows: how many units exist, whether the password rule was documented, and whether the product is still in production. A rule that was documented somewhere is worth an analysis effort. A rule that was generated randomly on a production line is not.
Related reading
- TMS320LF2401AV and extraction without an external bus — where the password is only the first of several constraints.
- TMS320LF2403 and the boot ROM as an alternate path — a route that does not involve unlocking at all.
- TMS320F243PGE, a later part with a stricter module — useful for seeing how the same idea evolved.
FAQ
Is the password stored outside the protected region? It is in the array, at a fixed location, and it is the one thing the module must be able to compare against while locked.
Does a mass erase clear the password? Yes, and it clears the program with it, which is why erasing is not a recovery method.
Can the password be read out once the module is open? Once unsecured the array is readable like any other region, so yes.
Why does the debugger report the part as secured when the password is blank? Because it is secured. Blank flash is not the absence of a password, it is a password of all ones.
Conclusion
The 24x password is data, not a fuse, and that single design choice produces both the weakness and the constraints. Measure which of the five password states applies before attempting anything, expect the all-ones case to be common, and treat the unlock as a per-session operation rather than a permanent change.