LPC2132FBD64: The First Part In The Family With A DAC

A file can be byte-for-byte plausible and still be wrong. That is the characteristic failure when a physical read ignores the error-correction bits beside the user data. The LPC2132FBD64 is a 64 KB flash, 16 KB SRAM ARM7TDMI-S device in an LQFP64, running at 60 MHz, and it is the first member of the LPC213x line to carry a 10-bit DAC alongside its single 8-channel 10-bit ADC. To copy secured LPC2132FBD64 software cleanly, the check bytes have to come out with the code.

What Error Correction Does To A Read

The flash controller on this line uses a Hamming code capable of correcting a single bit in a read word. In normal operation that is invisible: the CPU asks for a word and gets the corrected value. In an extraction, the raw array contains both the user word and its check bits. A capture that keeps only the user words can hide a marginal cell that the on-chip logic would have repaired, and the resulting binary will contain one wrong instruction in what otherwise looks like a clean image.

We read the array in sector-sized blocks, retain the check bytes, and repeat the capture from a second angle. Where the two disagree, the ECC information is used to decide which value the running part would actually have seen. The note accompanying the delivered file states how that was handled rather than presenting an apparently perfect dump.

Sixteen Four-Kilobyte Sectors

Sixty-four kilobytes means sixteen 4 KB sectors with no large-sector region at all. That is a different geometry from a 256 KB or 512 KB member of the family, and it changes what a partial erase costs. Erasing sector 0 removes one sixteenth of the array, but it also removes the vector table, the reserved checksum word at 0x14 and the Code Read Protection word at 0x1FC. Those three live within the first 512 bytes.

The boot block is separate, sitting at the top of the memory map and holding the ISP and IAP routines. ISP and IAP commands cannot write, erase or branch into it. On a 512 KB sibling it consumes the last 12 KB and leaves 500 KB for user code; on this 64 KB part the same boot block is present but the user array is small enough that designers rarely notice the reserved region.

One Word Selects The Whole Policy

Protection is a single 32-bit value at 0x1FC. 0x12345678 gives CRP1: JTAG disabled, ISP read and compare disabled, writes to sector 0 blocked, sector erase still permitted. 0x87654321 gives CRP2: only a full-chip erase remains available over ISP. 0x43218765 gives CRP3: ISP entry through P0.14 is disabled when valid user code is present. Any other value leaves the part open.

“Valid user code” is a checksum test, not a signature. The boot ROM sums the eight exception vectors and requires zero, with 0x14 holding the two’s complement of the other seven. If that test fails it drops into ISP. A disturbed sector 0 can therefore change the observable behaviour of CRP3, which is a strong reason to read the first few words before trying anything that erases.

Early bootloader revisions implemented only the 0x87654321 level. Later /00 and /01 devices expose all three. The boot code version is read over the serial interface before any plan is chosen, and a CRP change only takes effect after a complete power cycle rather than a reset. Both facts are logged at intake.

The DAC Is A Clue, Not A Storage Area

The 10-bit DAC and the ADC result registers are peripheral-side. They never appear in a flash dump. What does appear is the code that writes to them, which is often enough to identify calibration constants stored in a flash sector used as data. A sector map showing programmed but non-executable content is usually where those constants live, and separating them from code is part of a useful delivery.

Runtime state in the 16 KB of SRAM is gone at power-down. The two UARTs, two I2C buses, SPI and SSP, six PWM outputs and the vectored interrupt controller are all configured by the recovered firmware, not captured with it.

Scope

We ask for the marking, board photographs and the observed boot behaviour before quoting a route; the contact page is where that starts. The NVRAM article is useful background on why retention is a separate problem from read protection, and this AT32F423 case shows a family where a protected region is genuinely execute-only. Within this line, the LPC2134FBD64 doubles the analog inputs and the LPC2194HBD64 shows what four CAN channels do to a 64-pin package.