LPC2134FBD64: Sixteen Analog Inputs, No CAN

Sixteen analog inputs on a 64-pin package is an unusual pin budget, and it is the fastest way to recognise this part on a board. The LPC2134FBD64 carries two independent 8-channel 10-bit ADCs, a 10-bit DAC, 128 KB of flash and 16 KB of SRAM around a 60 MHz ARM7TDMI-S core. There is no CAN controller and no external bus. Anyone trying to hack locked LPC2134FBD64 flash has to work within a fairly small, entirely on-chip memory system.

Why Two Converters Change The Disassembly

Two ADCs mean two sets of result registers, two interrupt sources and two pin-connect-block configurations. Firmware that samples both will show paired initialisation sequences and paired vector entries. Recognising that pattern matters when a recovered image has to be understood rather than merely archived: a single flat disassembly will interleave the two conversion routines, and the interrupt vector addresses are the cleanest way to separate them.

The converters themselves hold no code. Their readings at power-down are lost with SRAM. What survives in flash is the setup, the calibration tables and the logic that consumes the samples.

What Gets Closed, And In What Order

Code Read Protection is one word at 0x000001FC. Does the boot ROM read it before or after it decides whether user code is valid? The vector checksum at 0x14 is evaluated first: the eight exception vectors must sum to zero, with 0x14 holding the two’s complement of the other seven. Only then is control passed to the application. CRP3’s rule about disabling ISP entry through P0.14 is explicitly conditional on valid user code being present, so the order is not academic.

The three levels then remove capabilities in sequence. CRP1 disables JTAG and ISP read and compare, and blocks writes to sector 0, but sector erase still works. CRP2 removes write-to-RAM, copy-RAM-to-flash and go, leaving only full-chip erase. CRP3 closes the serial entry pin. None of them encrypts the array; they are access rules enforced by boot ROM code, not a cipher.

This is a different address from the 0x2FC used on Cortex-M LPC devices. Tools written for the newer families can report a false “unprotected” result here and then issue an erase that destroys the only copy.

Is A Partial Erase Ever Useful?

Rarely. A 128 KB part has eight 4 KB sectors at the bottom and three 32 KB sectors above them. Sector 0 contains the vectors, the checksum and the CRP word. Any operation that touches it removes the entry point of the application. On a 512 KB device the same operation costs proportionally less; here it costs the whole boot path.

In-application programming is the interesting exception, because CRP does not disable it. IAP is called by code already running on the part through a ROM entry at 0x7FFFFFF0, and it can erase and rewrite the array while a protected application executes. A field-update routine found during disassembly is therefore both a functional clue and a warning: the customer may already have a supported way to reload firmware, provided the authority to use it exists.

How We Verify A Result

The delivered binary is checked the way the boot ROM checks it. We recompute 0x14, confirm the reset vector points into code, and mark which sectors were programmed and which were left at 0xFF. The image is read twice; on flash with Hamming correction, a single-bit marginal cell can otherwise be corrected into a plausible but wrong instruction. Where the array has been read physically, the check bytes travel with the data.

ARM and Thumb instruction streams can alternate at subroutine boundaries, so a recovered image is decoded with that in mind rather than as a uniform 32-bit stream. That also affects how we look for the field-update path: a Thumb-compiled IAP wrapper is easy to miss if the disassembly is set to ARM only.

One board-level detail is worth checking early. P0.14 is sampled while reset is low, and on a production gateway it is often reused as an external interrupt or a general-purpose line with no test point at all. If the pin is not accessible, the serial bootloader is unreachable irrespective of the protection level, and the decision tree collapses to the physical route. We ask for a schematic or clear photographs of the connector area rather than assuming a service UART exists.

Related Work

Our service scope describes intake and the device states we accept. The protection walkthrough sets out the layers in order, and this ARM7-labelled 32-bit case is a useful comparison on a different core. For the two nearest neighbours in this line, see the 32 KB LPC2131FBD64 and the 256 KB LPC2136FBD64.