The I²C clock-stretch bug we caught four weeks before fab

Adam Szefer · Co-founder & CTO

Prev. Bloomberg · Gyfted. Systems and simulation infrastructure — the engine that runs your firmware against the circuit.

On the homepage we tease a design-partner catch: SCL t_HIGH measured at 0.42µs against a 0.60µs floor. This is the longer version — what broke, why idealized peripherals would have missed it, and how the assertion looks in CI.

The symptom we were aiming to prevent

The board mixed a Cortex-M master with a sensor that stretches SCL under load. Firmware timeouts and timing assumptions were tuned against a friendly evaluation module — not against the stretch behavior called out in the production part’s datasheet. On a physical spin that mismatch shows up as intermittent NACKs and “works if I lower the bus speed.” On a calendar it shows up as a respin.

Why the eval kit lied politely

Eval kits and register-level stubs often never stretch. Drivers ship with timeouts that only fire on real silicon. If your simulation always ACKs on time, you are training the stack for a board you are not building.

What the failing check looked like

We ran unmodified firmware against a netlist-derived platform. The assertion watched SCL high time during the transfer that stressed the slave. When t_HIGH dropped below the datasheet floor, the run failed with a traceable message — the same class of signal you would chase on a scope, available before copper.

Failure summary (simplified from the partner run)
FAIL  i2c1  t_HIGH
  measured  0.42 µs
  required  ≥ 0.60 µs
  context   sensor stretch during burst read
  firmware  payload.elf @ bring-up suite
  delta     4 weeks before scheduled fab

What we changed before tape-out

Firmware timing and retry policy were fixed against the real contract. The assertion stayed in CI so a later pinmux or clock-tree change could not revive the bug silently. The first articles still needed bench time — for sensor truth, not for rediscovering stretch.

Takeaway for embedded teams

If your risk is HW/FW integration, demand that pre-silicon simulation can disagree with you. Green bars from always-polite peripherals are not safety. Encode the datasheet limits you already fear as tests, and run them on the topology in your netlist.

HardLabs

What HardLabs does — join the design-partner pilot

We build a digital twin from your netlist, schematic, and BOM, run your real firmware against it, and fail CI when pinmux, buses, or timing contracts break — weeks before bring-up on hardware.

  • A digital twin of your hardware, built from your netlist, schematic, and BOM.
  • A virtual lab: scopes, logic analyzers, and firmware debuggers in simulation.
  • Auto-flagging of power-sequence errors, output contention, and race conditions.

Pilot details · App

Related

All blog