Five traps from bringing up a two-chip optical module over I2C from an RK3588 — one where the read command was silently malformed, one where a register value meant the opposite of what we assumed, and three that are cheaper to avoid than to debug. Every conclusion here was verified on hardware, and the one place where we were wrong for two weeks is included.
The single rule this page exists to deliver — a bus that does not answer NACKs. A bus that answers and returns all zeros for its entire register map is telling you your read path is wrong. Those two failures look identical in a log and have nothing in common.
An RK3588 host driving an optical module over I2C at address 0x1b on one bus: a display controller paired with an LED driver that owns the three current channels. Between the SoC and the module sits an FPGA that has historically owned that bus. On a few production units one colour channel was visibly dim, producing a yellow white field.
The first diagnostic log came back with every register reading 0x00000000. The conclusion drawn from it — that the modules were faulty, or that initialisation had failed — was wrong twice over, and knowing why is the whole point of the page.
The vendor's protocol describes a read as a pair of transfers, not a single one. A write-side transfer selects the sub-address that means "read a register" and carries the register number; only then does a read-side transfer return the data.
Read part 1 (to 0x36):
0x36 | 0x15 | register
Read part 2 (from 0x37):
0x37 | 32-bit data
The 0x15 sub-address is what declares "this is a register read".
w1@0x1b 0x03 r4
Register number sent directly, no sub-address. The device acknowledged every time — and returned zeros every time.
Correct form:
w2@0x1b 0x15 0x03 r4
Nothing in the failure looked like a protocol error. No NACK, no bus timeout, no arbitration loss. The device politely returned four bytes. That is precisely why the mistake survived a full debug cycle: every mechanism we normally use to detect a bad transaction reported success.
This is worth reading as a table, because each row is a conclusion a reasonable engineer would draw from the evidence available at the time.
| What the tool reported | What we concluded | What was actually true |
|---|---|---|
Device ID = 0x00 (documented legal set 0xA0 / 0xA2 / 0xA6) | "The chip on these boards is not the part we ordered" | The ID was never read. The read path was wrong; the parts were correct. |
| All three current channels = 0 | "The nine configuration writes are failing — 0 of 9 accepted" | The writes were fine. Only the verification reads were broken, so nothing could ever appear accepted. |
Status poll on 0x3A always 0, bit 0 clear | "Propagation completed successfully" | The poll was reading a constant zero. A success flag that can never be false is not a check. |
| Every companion-driver register = 0 | "The LED driver is unresponsive or unpopulated" | The companion driver was healthy. Same malformed read, second device. |
The honest consequence. That log could not prove the boards were faulty, and it could not prove initialisation had failed either — because the measurement instrument was broken, not the thing being measured. A log that cannot be trusted in either direction is worse than no log: it consumes the credibility of a real defect and delays finding it.
After the read path was fixed, a second defect surfaced underneath it: the tool had been writing 4 into all three current registers and calling that "full brightness".
We read the controller's brightness register section, which describes an 11-bit field where 0x000 means 100% and larger values dim the output. So 4 looked like "essentially full brightness". Consistent, plausible, and about the wrong device.
The same value written to a different chip's register is a current code on the LED driver, where larger means brighter. 4 is not near-full brightness; it is 23 mA, with a ±14 mA tolerance.
| Code | Current | What the value is for |
|---|---|---|
0 | 0 mA | Channel off |
4 | 23 mA ±14 mA | A test point. Relative error around 60%. Not a working point — but it is what our tool shipped as "full". |
256 | 272 mA | The datasheet's own calibration point |
800 | 809 mA | The value our reference FPGA design actually writes to the red channel |
1000 | 1007 mA | The reference value for green and blue |
1023 | 1030 mA | Full scale |
| Symptom | Mechanism at 23 mA |
|---|---|
| White field looks yellow | Three channels at 23 mA each, with ±14 mA of relative error, means the current ratio between channels is uncontrolled rather than the absolute brightness being low. |
| Red shows horizontal banding | At a small fraction of nominal current the boost stage enters a pulse-skipping regime and the output ripple becomes visible in the picture. |
| Green and blue look "fine" | A single colour at the wrong amplitude still reads as that colour to the eye. Only the ratio across channels produces a visible fault, which is why single-colour tests pass and the white field fails. |
The generalisation: before writing a number into a register, find the table that maps code to a physical unit, and read the tolerance column before the value column. A tolerance that is large relative to the value is the document telling you this is a verification point, not an operating point.
An FPGA had historically owned this I2C bus. While it still held it, every transaction from the SoC NACKed — which we initially read as a dead module. Two masters driving one bus is not a mergeable situation; it is a bus that fails and then works. Get the other master released, in writing, and then verify the release before blaming the bus.
A front-end reset register was in the sequence because it was in the sequence. The datasheet says plainly that it has no required application; sending it resets the pixel-clock domain and the picture never returns. Read what the document says about not writing a register, not only about writing it.
Leaving the internal test-pattern mode required clearing one register, which was not enough: the pattern number, the resolution register and the format register all stayed on the test configuration, so external video never locked. Exiting a special mode means restoring every register the mode changed, in the right order.
Neither of these is clever. Both are cheap, and both would have ended the debug in the first hour.
| Instrument | What it does | Why it works |
|---|---|---|
| A/B read diagnostic | Reads the same register twice, once with the suspected-correct command and once with the old one, and prints both | Converts an invisible protocol difference into a visible one. If both return the same value the command was never the problem; if they differ, the argument is over. |
| Known-answer test on the device ID | Checks the ID against the documented legal set before any measurement is printed | Makes the tool refuse to render a broken read as a physical quantity. This is the check that stops a zero from being displayed as "1085 mA, normal". |
| Good-versus-bad register dump | Full dump from a known-good unit and from a suspect unit, then a diff | Turns "some units are dim" into a list of registers that differ. It also distinguishes a real hardware difference from a formatting difference in the dump. |
| Internal test patterns | Drive the module's own generated patterns, bypassing the external video input entirely | Splits the problem in two: a fault that follows the pattern is in the module's optical path; a fault that only affects external video is upstream of the module. |
Sequence matters. Run the A/B read and the known-answer test first, before measuring anything. We ran them last, after a week of conclusions built on top of a broken read path — and every one of those conclusions had to be withdrawn.
The read path was malformed and had been for the life of the tool. The working point in the tool was a test point. The three current registers are a per-channel current code on the LED driver, verified against the driver's own readback of the same value. The reference design's working values are consistent with the datasheet's current formula.
That every unit with a colour cast will be fixed by the working-point change. A wrong current ratio and a failing LED string produce the same white-field symptom, and separating them needs the module's own pattern test plus a measurement at the test points. That step belongs to the hardware bench, not to the register tool.
Why the boundary is written down. The most expensive outcome of a long debug is not the lost time — it is confidence borrowed from a conclusion that was never actually tested. A tool that produces numbers can make a bench measurement look unnecessary. Naming what the tool cannot see is what keeps that from happening.
| # | Check | What it prevents |
|---|---|---|
| 1 | Does the whole map read zero or all-ones? | Condemning a part that is answering you correctly and being asked wrongly |
| 2 | Is there a two-stage read, and did you send both stages? | A read command that returns a plausible-looking constant |
| 3 | Did a known-answer register pass first? | Rendering a broken read as a physical measurement |
| 4 | Do you know which chip owns this register? | Applying one device's semantics to another device's register |
| 5 | Is the tolerance small relative to the value? | Shipping a test point as a working point |
| 6 | Can the success flag ever be false? | A status poll that reads a constant and reports success forever |
Six numbers that decide a project, four that mislead, and how to verify each.
Read nextTwo backlight currents nineteen times apart, and how to arbitrate before layout.
Read nextThe number on the datasheet does not survive contact with a real model.
Send us the register log and the two datasheets. We will tell you which reading we would distrust first — and which conclusion in the log has not actually been tested yet.
Start a project → All Tech Notes