PostHeaderIcon PIC18F26K80: Getting Past “Secured Flash” as a Description

“Secured flash” is a conclusion, not an observation. It is what someone writes after a programmer returned zeros, and it collapses a set of quite different device states into one word. On a 64K part with four application blocks, a boot region and separate table-read protection, that collapse loses almost everything useful.

The useful version of the statement names which region is closed. That is obtainable, and it changes what the next step should be.

The layout that the word hides

The array is organised as a boot region at the bottom and application blocks above it, with protection applied per block. The boot region holds the reset vector and, usually, a loader.

Region Holds Protectable separately
Boot region Reset vector, loader Yes
Application block 0 Application entry, interrupt vectors Yes
Application block 1 Application code Yes
Application block 2 Application code Yes
Application block 3 Application code, constants Yes

Six independent decisions, in other words, each of which can be open or closed, readable or write-protected. A device described as “secured” is a device where all of them happen to be closed — or a device where one is closed and the read attempt hit it first.

The reading that distinguishes them

Protection state is held in configuration, and configuration is readable through the programmer. So the first operation on an unknown device is not a read of the array; it is a read of the configuration, followed by interpretation.

From it you learn, per block, whether reads are gated and whether writes are gated. Four combinations per block, six blocks, and the pattern tells you what the vendor intended:

  • Boot region closed, application open — the vendor’s loader is secret, the customer’s code is not.
  • Boot region open, application closed — the loader is documented and the application is the asset.
  • Everything closed — the device shipped locked, and the only question is whether the password-equivalent exists (on this family there is none; the bits are the mechanism).
  • Nothing closed — the device is readable and the word “secured” was a mistake.

The fourth case is more common than it should be, and it is worth eliminating before any technique is considered.

Behavioural evidence when blocks are closed

A device with a closed application block still runs, and its behaviour is measurable. Three measurements give a good deal:

Start-up timing. Measured from reset release to first output activity, it bounds the initialisation work — and a device with a loader spends longer at start-up than one without.

Bus traffic. A K80 in a CAN product emits frames from the first moments after reset if its loader announces itself. Silence at start-up then traffic later is a different architecture from traffic throughout.

Response to the loader entry condition. If the device accepts an update, the loader is present and functional, and the update format describes the application’s layout.

The third is the most valuable and the least used. A device that can be updated over CAN is a device whose application begins at a known address, whose image has a known format, and whose verification is defined — all stated by the loader’s behaviour.

What cannot be recovered and why

On this family there is no password to supply. Protection is a set of configuration bits; a device with the read bits set will not produce its array for any sequence of operations that does not first erase it.

That makes the honest boundary sharp:

  • Configuration is recoverable.
  • Behaviour is recoverable.
  • The array is not, once read protection is set, unless it is erased first.

Any technique that claims otherwise is either erasing the device and calling the result a recovery, or reading a device that was not protected as believed.

A procedure that avoids waste

  1. Read and interpret the configuration.
  2. Identify which blocks, if any, are open, and read those.
  3. If the boot region is open, read the loader and extract the application’s expected layout.
  4. If a field-update path exists, exercise it and record the protocol.
  5. Decide, with the evidence, whether the remaining unknown justifies further work.

Step five is a decision, not a formality. On a device whose function is understood from behaviour and whose update path is functional, the value of further work is often zero — and saying so is more useful than continuing.

Related reading

FAQ

Is there a password on this family? No. Protection is configuration bits, and there is no value to guess.

Can a partially protected device be read? Yes, block by block, subject to the bits for each block.

Does a closed block still execute? Yes. Protection gates reads, not execution.

What does a working CAN update imply? That a loader exists at a known location, with a known image format and a defined entry point.

When is further work not worth it? When behaviour and update path together describe everything the project actually needs.

Conclusion

“Secured flash” describes a conclusion rather than a device. On the K80 family the device has six independent protection decisions, a readable configuration that states them, and behaviour that continues regardless. Naming which region is closed — and accepting that the array itself is not available once it is — turns a vague problem into a short, decidable list.

Comments are closed.