Decode R5F562G7ADXX RX62G Firmware

Two peripherals that compete for the same pins

The root number reads as a compromise: 128 Kbytes of code, 8 Kbytes of SRAM, 8 Kbytes of data flash, five-volt operation, and the CAN controller present on a die whose timer is the high-resolution variant. Decode R5F562G7ADXX and the compromise becomes concrete, because a CAN controller needs two pins and the timer needs six complementary outputs per three-phase stage, and on a hundred-lead body there are only so many pads to go round. Which functions the designer sacrificed is visible in the start-up code, and it tells you what the product does before you read a single control routine.

Decode means rebuild the modulation, not the syntax

Producing a listing that a disassembler accepts is the easy half. The hard half is reconstructing what the modulator was doing, and on this group that means recovering three things: the carrier period written into the timer, the dead time inserted between complementary edges, and the mapping from the control variable to the duty register. Those three values define the power stage, and they are usually written once during initialisation in a short block that is easy to miss because it looks like ordinary setup.

Where the eight kilobyte parameter area fits

With 8 Kbytes of data flash the application cannot log, so it stores. Expect a compact structure: a magic word, a version byte, the set points, the calibration offsets and a checksum, rewritten only when something changes. That sparseness is an advantage, because a nearly empty parameter block tells you the product was configured once and never touched, while a block with a rotated sequence of records tells you somebody has been changing settings in the field.

Reading a 128 Kbyte image honestly

At this size a complete manual review is feasible, and it is worth doing rather than sampling. Divide the array into the vector table, the start-up and initialisation region, the interrupt handlers, the control routines, the tables and the unused tail. Mark each boundary with the evidence that put it there. Where a boundary is uncertain, say so; a report that admits two uncertain regions is more useful than one that asserts a clean structure it cannot support.

Delivering the decode

The customer receives the image, the annotated map, the register summary and a short text describing the control topology that the firmware implies. That last item is the one that gets read. Comparable decode work on a part without the bus controller appears in the cloning R5F1007D data article, and the general method for turning recovered tables into documentation is described under reading a chip.

Where the parameter block usually sits

Eight Kbytes is four 2-Kbyte blocks, and firmware that expects to run for years spreads its writes across them. The usual structure is a magic word, a version byte, a payload and a checksum, appended at successive offsets until a block fills, after which the block is erased and the sequence restarts. Reading the four blocks in address order and sorting the records by an embedded counter reconstructs the change history of the unit, which is often more informative than the code itself.

Compare fill levels between blocks before drawing conclusions. A nearly full block next to a nearly empty one locates the rotation, and a block that is blank where the sequence says it should be populated is evidence of an interrupted erase rather than of a design choice. Record the finding with offsets, because the person reading the report will want to check it against the firmware that writes there. The same evidence-first approach on a different array is documented in the R5F100CD note, a wider capacity is compared in the R5F100FC article, and the delivery conventions are described under microcontroller extraction.

The transceiver has to come off power before the first command, and on a run of identical boards it is worth fitting the fixture with a switch that does it. A transceiver left powered holds a shared pin at a defined level, and the symptom is indistinguishable from a marginal contact, which sends the operator chasing the wrong problem. The same fixture should bring out reset and clock, so that the device stays in a known condition while the programming pair is exercised.


Tags: ,,,,,,,,,