Replicate PIC24FJ512GA606 Protected Firmware Image

A power-monitoring vendor asked us to replicate the protected firmware image of its three-phase meter, built on the PIC24FJ512GA606: 512 KB of program flash, 32 KB of SRAM, 64-pin package, a member of the GA6 generation. This generation changed the recovery landscape fundamentally, because its flash is dual-partition with live-update support: two independent partitions, each holding a complete application, switchable at runtime, with error-correction code under the array. Protection, layout and verification all differ from the single-array families, and this note keeps to those differences.

Two partitions change every question

The configuration-word session read the FBS family words as usual, but on this generation the partition control matters as much as the security fields: the array divides into two flash panels, and the active partition is a runtime decision the boot logic makes. Reading the active partition through ICSP gave the deployed build; the inactive partition held the previous build, and the diff between them was the vendor’s own update history, preserved by the hardware’s design. Neither partition read back blacked out: the maker’s configuration used general write protection only, which this family, like its relatives, applies to writes and not reads. The a GD32F303RK flash lock write-up covers the analogous active-versus-inactive question on GigaDevice’s dual-bank parts.

ECC and what it reveals

The GA6 generation applies error-correction code to its program flash, which has a forensic benefit: ECC status distinguishes rows that were never programmed from rows that were programmed and later erased, and from rows carrying live data. Our verification used that distinction to map the deployed build’s actual extent within its partition, flagging the vendor’s linker slack precisely rather than by inference. At half a megabyte, that mapping matters: 170,666 instruction words per partition leave room for a lot of unprogrammed tail, and the ECC evidence separated it cleanly. The a 256 KB RX62T in its first silicon stepping note performs the same extent-mapping on Renesas silicon by wear-pattern inference instead.

Replication with per-unit calibration intact

The meter’s calibration lived in a flash region the factory wrote through the firmware’s own self-programming path, per unit, at commissioning. Replication therefore followed the pattern this batch of work has seen repeatedly: the code image copied globally, the calibration read per unit through the firmware’s diagnostic channel and re-provisioned after the image install. The vendor’s diagnostic protocol reported calibration digests, which anchored the per-unit reads, and the live measurement comparison validated them against each meter’s reference readings. The a BGA-packaged STM32F411VCH6 and an STM32F407ZET6 clone reports document the same per-unit-state discipline.

Verification and delivery

Acceptance ran on the maker’s test rig: replicated meters against references through the full metering accuracy suite across the load range, all passing. The delivered package held both partition images, the diff between them, the ECC-evidenced extent map, the per-unit calibration archive and the diagnostic-protocol documentation. For a {x-p18} design, the two questions that determine the job are which partition is active and where the factory state lives; the an STM32F413VGT6 three-store audit and the boot-cluster recovery on an RL78 boot-cluster note frame the same questions on other architectures.

Reading ECC status directly

The generation’s ECC evidence is readable, not merely inferable: status fields distinguish single-bit-corrected rows from clean rows, and the bench read them alongside the array. Four rows across the fleet showed corrected-bit history, all in the region the calibration rewrites had touched, and none in the code area, which both validated the wear model and gave the maker a concrete threshold for retiring units. ECC status as a fleet-health metric is a bonus this generation hands recoveries that no single-partition family offers, and the delivered report includes the raw status dump for the maker’s reliability group to extend.

Digest coverage across the diagnostic channel

The vendor’s diagnostic protocol reported calibration digests, and the job’s verification budget went into proving the digests covered the whole calibration region rather than a summary of it. The disassembly’s digest routine settled it: the span covered every calibration row including the padding the factory tool wrote, so a matching digest guaranteed the full region. That proof converted the per-unit reads from samples into complete captures, and the migration tool now asserts coverage itself before trusting any unit’s restored calibration. Digest-based verification is only as strong as its coverage proof, which is why the proof, not the digest, is the deliverable.