MSP430G2452: Seven Things a Locked Device Still Tells You
Protection is usually described as if it made a device opaque. It does not. It closes one channel, the one that reads the array, and leaves everything else in place. A locked device continues to execute, continues to drive its pins, continues to consume power in a pattern determined by its code, and continues to talk on whatever bus the product uses.
The practical question is therefore not how to open the array but what the array was needed for. On a great many projects the answer is one of the seven things below, and several of them do not require the array at all.
The channels, and what each yields
| Channel | What it gives | Cost |
|---|---|---|
| Supply current over time | Loop structure, sleep duty cycle, activity periods | Minutes |
| Pin behaviour at power-up | Initialisation order, which peripherals are enabled | Hours |
| Bus traffic | Protocol, message timing, data layout | Hours |
| The device’s own interfaces | Whatever the program is willing to export | Variable |
| The bootstrap loader | A full image, if the password can be derived | Variable |
| Other devices on the board | Parameters, calibration, identity | Hours |
| Physical access | The array itself | Weeks |
Current as a program trace
The instantaneous supply current of a running microcontroller is a function of what it is doing. Executing code draws one current, sleeping draws another, driving an output draws a third, and switching a radio or an LED produces a distinct step.
Recording that current over seconds or minutes produces a timeline of the program’s behaviour. On a low-power product the pattern is unmistakable: a long low period, a sharp rise, a burst of activity, a return to low. The duration of the burst and the period between bursts are numbers the program computes, and they constrain what the program can be.
This is the cheapest channel and the most underused. It requires a series resistor and an oscilloscope, and it answers questions that would otherwise need the array.
Pin behaviour as an initialisation order
Watching the pins during the first milliseconds after reset shows the order in which the program configures things. The first pin to move is the first thing initialised, and the timing between movements reflects the code between them.
On a device that drives a display, a motor or a bus, that sequence is the start-up specification of the product. It is also the sequence a reimplementation must reproduce, which makes it the most directly useful observation available on a locked part.
Bus traffic as the protocol
If the product communicates with anything, the traffic is readable with the device in place and running normally. There is no protection involved: the bus is outside the device.
Capturing a full operating cycle gives the protocol. Capturing a service or configuration sequence gives the commands. On products with a diagnostic port, the traffic during a service procedure frequently contains more than the procedure requires.
The device’s own export paths
This is the channel that turns a locked device into a readable one, and it is a property of the design rather than of the protection.
Any feature that moves data out of the device can move program data out of the device. A calibration export, a diagnostic dump, a firmware update with a verify step, a debug command left in production firmware — each is a path the original authors built and the protection does not close.
Finding them means enumerating the interfaces and exercising them, which is a day of work that regularly replaces a week of anything else.
The loader, and the password question
Where the loader exists, its password is derived from the device’s own memory rather than stored separately. That creates a dependency worth stating: a device whose vector table can be read has a loader that can be entered, and one whose vector table cannot be read has a loader that cannot.
Which means the loader is a route for devices with intact programs and inaccessible arrays, but only where the vector table is somehow obtainable — from a second unit, from an update file, or from the product’s own documentation.
Everything else on the board
A board carrying a locked microcontroller usually carries other parts that are not locked. Serial memories hold calibration. Identity chips hold serial numbers. Sensors hold factory trim. Analog front ends hold their own correction values.
Reading the whole board before concluding that the project depends on the microcontroller is not a detour. It frequently supplies the parameters that were the actual requirement, and it sometimes supplies enough of the program’s data that the array becomes unnecessary.
When physical access is the only answer
If the requirement is the program itself, and no export path exists, and the loader is closed, then the remaining route is physical. That is a different kind of work with a different kind of cost, and it should be entered with a clear statement of what it can and cannot deliver.
It is also the point at which the honest advice is sometimes to reimplement. A device whose behaviour has been fully characterised through the six channels above can be replaced by a program written against that characterisation. The result is a product that works, which is usually the actual goal, rather than a copy of a program, which is usually the means.
Related reading
- MSP430G2452 and the calibration problem after a copy — the same part, a different question.
- MSP430F2252 and separating locked from damaged — establishing that the first channel is available at all.
- MSP430G2413 and deciding when a project is not worth starting — the judgement that follows from this list.
FAQ
Can the array be read through any of these channels? Only through an export path the program itself provides. The others give behaviour, not content.
Is current measurement really useful? On a low-power product it is the fastest way to see the program’s structure.
Does the loader always exist? No, and where it exists its transport may not be brought out.
Why read the rest of the board first? Because the requirement is often a parameter, and the parameter is often not in the microcontroller.
Conclusion
A locked device is one closed channel and six open ones. Measure the current, watch the pins, capture the bus, exercise the interfaces, check the loader, read the rest of the board, and only then consider the seventh. Most projects that begin with the array turn out not to need it.