Posts Tagged ‘fram mcu firmware copy’

PostHeaderIcon A Working Copy Is Not a Maintainable Copy

The acceptance test for a copy is usually the same as the acceptance test for a repaired unit: does it work. That test passes often, and then the product enters a life in which three things that nobody checked turn out to matter.

A product has to be updated, because bugs are found and features are added. It has to be certified, because the market requires it. It has to be serviced, because units fail. A copy that was never designed for those three activities will fail at the first one that arrives, which is usually within a year.

Updatability is a property of the boot stage

An application image cannot update itself. The update is performed by a separate program — the bootloader — which is resident, which runs before the application, and which accepts a new image over some interface.

If the copy included only the application, the copy has no updater. The device works, and it is frozen at the version it was copied from.

Copy contains Update possible Why
Application only No No updater exists
Bootloader and application Yes The updater is present
Bootloader, application and signing key Yes, with verification The update is authenticated
Everything plus the update interface Yes, in the field The transport is present

The third row is where a second problem appears. A bootloader that verifies a signature will reject an image signed with a different key, and the copy will not have the original’s private key — it has the public key that verifies. Updating a copied device therefore requires either the original’s signing capability or a bootloader that accepts anything, and neither is available.

Update path Requires Available on a copy
Unsigned, no verification A transport Yes
Signed, public key present The matching private key No
Signed by the vendor A vendor-issued image No
Serial or debug programming Physical access Yes, but not in the field

Certification is a property of the whole device

A product’s certification is granted to a specific configuration: this firmware on this hardware, with these settings, meeting these requirements. A copy is a different device in the eyes of a certification body, and the difference is not resolved by the firmware being identical.

Certification aspect Determined by Affected by a copy
Radio emissions Firmware plus layout plus clock Yes, if the clock differs
Safety function Firmware plus configuration Yes, if the configuration differs
Security claims The protection state Yes, if the protection is not copied
Traceability Serial numbers and records Yes, entirely

The third row is the one that matters for products sold on a security claim. A device whose read protection was not restored is a device whose claim is false, and the copy has silently invalidated it.

Serviceability depends on the parts nobody copies

A service engineer needs three things: to identify the unit, to read its state, and to attach to it.

Identification comes from a serial number or an identifier, which lives in a region that a firmware copy does not include. A copy without an identifier is a unit that cannot be distinguished from its siblings, which breaks warranty handling, field failure analysis and recall.

Service need Provided by Included in a firmware copy
Identify the unit Serial number, in a protected region No
Read fault state A log region plus the code that writes it Code yes, region maybe
Attach a debugger Debug port enabled and unlocked No, if the copy is locked
Reprogram in the field Bootloader plus a transport Only if copied

The third row is a subtle one. A copy is usually made with the protection set, because the point of the exercise is to produce a device that resembles the original. That means the debug port is locked, which means the service engineer cannot attach to a field failure. The original had the same limitation, so this is not a regression — but it is frequently discovered at the worst moment.

The lifecycle question to ask before copying

Four questions, asked before the first copy, determine whether the copy will survive its first year.

Will this product need a firmware update? If yes, the bootloader and the update transport must be in scope, and the signing question must be answered.

Is the product certified, and does the certificate name a firmware version or a configuration? If yes, the copy has to reproduce the configuration exactly, and the certification may have to be re-obtained.

Question If yes Consequence for the copy
Will it be updated? Yes Bootloader and signing in scope
Is it certified? Yes Configuration must match
Will it be serviced? Yes Identifier and access in scope
Is it sold on a security claim? Yes Protection state must be restored

The fourth question is the one that changes the legal exposure as well as the technical scope, and it is discussed in cloning an IC program.

The cost of finding out late

The three lifecycle failures have very different costs depending on when they are discovered, and the difference is what justifies asking the four questions early.

An update failure discovered during development costs a rebuild of the bootloader. The same failure discovered in the field costs a service campaign, because the units cannot be updated remotely and must be collected.

Failure Found at prototype Found in the field
Cannot be updated Rebuild the boot stage Collect and reflash every unit
Cannot be certified Re-test with the right configuration Withdraw and re-certify
Cannot be serviced Add a debug path Replace instead of repair
Duplicate identity Assign new identifiers Reconcile records and customers

The fourth row is the one that is not a technical problem at all. Two units with the same identifier produce a database that cannot distinguish them, and the correction involves explaining to a customer why their device has changed identity.

What a maintainable copy includes

The deliverable for a copy that is intended to live is larger than the firmware, and the extra items are cheap once they are identified.

The bootloader, if one exists, extracted separately and delivered with a note on its interface and its verification behaviour. The configuration bytes, read and documented. The calibration page, read and noted as per-unit or transferable. The identifier policy, which is a decision rather than an artefact: whether each copy gets a new identifier, the original’s, or none.

Item Delivery Note required
Application image Binary plus region map Which sections are included
Bootloader Binary plus interface description Verification behaviour
Configuration Byte values plus meaning Per-part or transferable
Calibration Values plus validity range Batch dependency
Identifier policy A decision How new units are identified

Where this fits

The technical causes of a copy that does not work at all are in copy failures, and the volume effects that appear when a copy becomes a production run are in copying an IC program.

The signing problem has a technical root in secure boot, because the reason a copied device cannot accept a new image is that its boot stage verifies against a key the copy does not hold. The completeness question that determines whether the copy even boots is the section layout in extracting MCU firmware.

What we deliver for this class of work is the image plus a maintainability statement: what the copy can do, what it cannot, and which of the four lifecycle questions has an unfavourable answer. A customer who is told before the run that the copies will be unupdatable has a choice. A customer who is told afterwards has a recall.