MSP430G2252: A Binary, a Disassembly and a Project Are Three Deliverables
The word firmware covers three artifacts that are not interchangeable. A binary is a sequence of bytes at addresses. A disassembly is those bytes with the machine code turned back into instructions and named. A project is something a compiler accepts and a person can modify.
The difference is not cosmetic. Each level enables a different set of future operations, and the effort separating them is not linear. Most disagreements about recovery work come from a customer expecting the third level while the quote was written for the first.
What each level lets you do
A binary lets you reproduce the device. Program it into a blank part and you have the product back. Nothing else is possible: it cannot be modified, it cannot be recompiled for a different memory map, and it cannot be reviewed.
A disassembly lets you understand and patch. You can read the program, find the constant you need to change, and alter a byte or two. This is enough for a surprising number of real requests, including changing a hard-coded serial number, removing a check, or adjusting a delay.
A project lets you maintain. Add a feature, change a peripheral, port to a different device, hand it to a developer who was never involved in the recovery.
| Deliverable | Enables | Typical effort |
|---|---|---|
| Binary | Reproduction | Hours, dominated by extraction |
| Disassembly, annotated | Understanding, small patches | Days |
| Buildable project | Maintenance, porting | Weeks to months |
The patch route and why it works more often than people expect
Between the binary and the project there is a practical middle that is worth knowing because it covers most modification requests at a fraction of the cost.
The technique: keep the original image, find free space in the flash that the program does not use, assemble the new routine into that space, and change the original function’s first instruction into a jump to the new location.
Three details decide whether this works.
Free space. A program this size usually leaves the region between its last section and the top of the array unused, or leaves erased pages inside its own extent. Either is usable.
Jump range. The jump instructions on this core have a limited offset. Reaching a distant address needs a two-step construct: a conditional jump to a nearby unconditional branch, or an absolute branch instruction. A patch that assembles but silently jumps to the wrong address is the classic failure here.
Absolute addresses. Anything in the original code that references the modified function by address — a vector entry, a function pointer in a table — still points at the original location. Changing the first instruction to a jump handles that, because the original address now executes the branch.
The patch route fails when the change is large. Adding a routine is easy; restructuring a state machine is not.
What the disassembly actually needs
An annotated disassembly is only useful if the annotation is real. A listing with addresses and instruction mnemonics is barely better than the binary, because the reader still has to work out what each routine does.
The annotation that earns its place:
- a name for every routine, derived from what it does,
- a comment on every peripheral access, naming the register and the field,
- the state machine drawn out, if the program has one,
- the constants tabulated with their meaning,
- the memory map, including the information region.
That is the deliverable that answers the question a customer usually has, which is not how do I rebuild this but what does it do.
When a project is genuinely required
Four situations justify the full route.
The product has to be ported to a different device, because the original is obsolete or unavailable. Porting requires the source to be recompiled against a new memory map, and a binary cannot be recompiled.
The program has to gain a feature that changes its structure rather than its constants. Any change that adds state cannot be patched into free space without becoming an exercise in assembly programming.
The product is subject to a process that requires reviewable source. A regulator or a customer’s quality system may require it, regardless of the technical need.
The product will be maintained for years by someone who did not do the recovery. A disassembly is a snapshot; a project is a working environment.
Setting the expectation
The honest way to quote this work is to state the level explicitly and describe what each level costs, then let the customer choose. That conversation takes ten minutes and prevents the most common failure in this business, which is a delivery that meets the letter of an agreement and not the need behind it.
A useful question to ask: what do you want to do with it in two years. If the answer is nothing, the binary is enough. If the answer is change one number, the disassembly is enough. If the answer involves a new board, the project is the only answer.
What the binary level still gives you
It is worth not dismissing the first level. For an obsolete machine where the goal is to keep one unit running, a binary plus a programmed spare part is the entire requirement, and it is deliverable in a day.
Adding annotation to that binary is the cheapest upgrade available, and it is usually worth doing even when nobody asked, because it converts an opaque artifact into a maintainable one at a cost measured in hours.
Related reading
- MSP430G2131 and the case where the image has two programs in it — a structure that changes what the deliverable should be.
- MSP430G2444 and the analysis that turns an image into a specification — the work between the second and third levels here.
- MSP430G2121 and the instruction set that makes reading practical — why the disassembly level is reachable on this architecture.
FAQ
Can a binary be turned into source automatically? A decompiler produces something that resembles source and does not rebuild. It is a reading aid.
Is patching in free space safe? Safe if the jump range and the absolute references are handled. Both are checkable.
Why is the project level so much more expensive? Because every function has to be understood well enough to be rewritten, not merely read.
What should be delivered with a binary? At minimum, the memory map, the vector table and the checksum.
Conclusion
Binary, disassembly and project are three products with three prices. Name the one being delivered, ask what the customer intends to do with it in two years, and use the patch route when the change is small. Most requests that sound like they need a project need an annotated disassembly and one afternoon.