← All writing

Support is a matrix, not a version number.

The chip changes the answerThree illustrative build rows compare SDK, camera setting and chip CSI capability. Only the newer SDK row with camera enabled and a CSI-capable chip includes the CSI check.SDKCameraChip CSICSI checkOlderOnNewerOnNewerOnNot checkedIncludedNot checkedNot checked is not a failed build.NoYesNo
The chip changes the answerEven with the newer SDK and camera enabled, the CSI check depends on the chip. A passing build applies to the combination tested; it isn’t a test of the physical camera.

What I learned making Rust bindings reflect both the SDK someone installs and the chip they build for.

esp-idf-sys #409: ESP-IDF binding support across releases and targets

ESP-IDF Rust bindings Infrastructure

At a glance

A Rust binding may depend on the SDK version, a component setting, and a feature of the actual chip.

If I say a Rust binding supports a new version of a C SDK, what should someone with an older board expect? The new version can know about the board without the board having every peripheral the SDK describes. A version number gets me to the right shelf. It doesn't tell me which parts are in the box.

That was the problem behind a change I worked on in esp-idf-sys, which exposes Espressif's C interfaces to Rust. I carried forward drinkcat's work and added changes in the review. What interested me was how to keep the bindings honest when a header moved, a component might be off, or one chip had a capability the next chip did not.

A version answers only one question.

When a new SDK changes the set of headers, a binding generator needs to know where an interface lives. The USB CDC console header in this change is a useful example. It had been pulled in through the older VFS grouping before version 6. The change ties the include to the console component when it's enabled, rather than assuming a sufficiently new SDK is enough.

The first column gives the SDK release for each illustrated build.

SDK version is one column.The first column separates older and newer versions. Two targets in the newer version can still differ.SDK versionSDK versionComponentChip capabilityBuild checkOlder SDKCamera onBoard B · No CSINo CSI checkNewer SDKCamera onBoard A · CSIIncludedNewer SDKCamera onBoard B · No CSINo CSI checkBuild coverage does not certify a board.
SDK version is one column.

The SDK version describes the headers available to the build, not every capability of its target.

The first column separates older and newer versions. Two targets in the newer version can still differ.

Diagram key
Top rowOlder SDK
The top example uses the older release.
Lower two rowsNewer SDK
They have the same release but different target capabilities.

That matters at the point a developer uses the binding. A missing or invalid declaration may otherwise look like a Rust problem, even when the real question is what the C SDK makes available in that configuration.

Name each condition where it matters.
  1. Find the header in the right release
  2. Check that the configuration includes the component
  3. Check the chip capability for target-specific interfaces

Individual headers have different conditions. The three questions aren't one blanket guard.

A component can exist without a particular peripheral.

The camera controller makes the distinction visible. The controller header is conditional on enabling its component. The CSI camera interface is separately guarded by a chip capability. Turning on the camera component doesn't make a chip grow a MIPI CSI interface. The JPEG paths give another example: encoding and decoding each have their own capability check.

The camera setting and the chip capability are two separate columns.

The component and the chip both matter.The middle columns show the camera component turned on and the CSI capability present on only one illustrated target.Component + chipSDK versionComponentChip capabilityBuild checkOlder SDKCamera onBoard B · No CSINo CSI checkNewer SDKCamera onBoard A · CSIIncludedNewer SDKCamera onBoard B · No CSINo CSI checkBuild coverage does not certify a board.
The component and the chip both matter.

The camera component can be on even when the chip doesn't have the CSI peripheral.

Same SDK and componentDifferent board capability

Compare the two newer-SDK rows. The camera component is on in both, but only one chip has CSI, and this example checks that row. Not tested is not failed; compiling is not running on the board.

The middle columns show the camera component turned on and the CSI capability present on only one illustrated target.

Diagram key
Component columnCamera on
All three examples enable the camera component.
Middle rowCSI available
Only this example target has the separate interface.

I prefer these checks close to the header they protect. One broad condition at the top is shorter, but it can smuggle in the assumption that everything below it shares the same support boundary. That assumption tends to surface later as a broken build on a configuration the author didn't use.

I ran into the same shape in Nix's Windows support, where Windows paths need more than separator replacement, on LinkedIn, opens in a new tab. A drive, a UNC share and a device root are different capabilities, not different spellings.

A build matrix is a useful, bounded promise.

The pull request lists coverage from ESP-IDF v4.4.8 through v6.0, with explicit target exclusions. A build matrix makes those choices reviewable. A missing cell can mean the pairing is intentionally outside the check. That is a different statement from a green build and a different statement from a broken one.

The right column records which example checks the CSI build path.

Say which builds the check covers.One cell has an included build check. The other rows are marked no CSI check, not failed.What the build provesSDK versionComponentChip capabilityBuild checkOlder SDKCamera onBoard B · No CSINo CSI checkNewer SDKCamera onBoard A · CSIIncludedNewer SDKCamera onBoard B · No CSINo CSI checkBuild coverage does not certify a board.
Say which builds the check covers.

A dashed cell marks a combination the example does not check for CSI.

One cell has an included build check. The other rows are marked no CSI check, not failed.

Diagram key
Middle rowIncluded
This combination is eligible for a CSI build check.
Dashed cellsNo CSI check
Outside this check, not a failed build.

The matrix checks compilation for the combinations it covers. It can't tell me whether a camera is wired correctly, what the device will do under load, or whether every board marketed with a given chip behaves the same way. Those need different evidence. I want the support statement to say where the build check stops.

The test I use for a compatibility claim is simple: could someone point to their own version, target, and configuration and tell which parts of that claim apply to them?

While the change was in review I put it this way on LinkedIn: A compatibility matrix is not paperwork, on LinkedIn, opens in a new tab.

For a closer technical look
  • The contributed change builds on earlier commits by drinkcat, preserved in the review.
  • The PR's matrix and exclusions describe the build configurations exercised, not field or hardware certification.

What I take from it

State support at the version, component, and chip boundary. A green build is evidence for that combination, not a hardware test.

Code and further reading

Also on
Browse all four projects