Article

Zephyr and Devicetree Hardware Revisions

Managing Hardware Revisions with Zephyr and Devicetree

Electronic products rarely remain unchanged throughout their development and production lifecycle. Circuit boards undergo revisions to accommodate component availability, correct design deficiencies, improve manufacturability, and introduce new capabilities. Even relatively minor changes to the electrical design can have implications for the embedded software.

During development, engineers may be working with several generations of prototype hardware simultaneously. Once a product enters production, earlier hardware revisions may remain in service for years. Maintaining compatibility across these revisions becomes an increasingly important aspect of software configuration management.

The challenge is to accommodate differences in the underlying hardware without unnecessarily fragmenting the application software.

Zephyr provides a mechanism for managing these differences through its board revision framework and devicetree architecture.

When a minor hardware change becomes a software problem

Consider a wireless sensor board based on Nordic Semiconductor’s nRF54L15 system-on-chip. The board contains a measurement sensor that communicates with the processor over SPI and uses a dedicated interrupt signal to indicate when measurement data is available.

During a circuit board revision, the electrical engineering team moves the sensor’s interrupt signal from P1.10 to P1.11. The SPI interface and the remaining circuitry are unchanged.

Firmware built for the newer hardware revision may appear to operate correctly when installed on the earlier board. The processor boots, Bluetooth communication works, and the software successfully reads the sensor’s identification register over SPI.

However, when the application initiates a measurement, no samples arrive. The sensor is generating its interrupt signal, but the processor is monitoring a different pin.

From the perspective of the electrical design, this is a relatively minor change. From the perspective of the embedded software, it represents a change to the hardware interface.

Without an appropriate configuration management architecture, even a change of this magnitude can lead to separate software branches, conditional compilation directives, duplicated configuration files, or hardware-specific logic distributed throughout the application.

As the number of hardware revisions increases, these approaches can become increasingly difficult to maintain.

Separating hardware configuration from application behavior

Zephyr’s devicetree architecture provides a structured separation between the hardware configuration and the software responsible for operating the product.

Rather than embedding processor pin assignments directly into application software or device drivers, the devicetree describes the hardware resources associated with each device.

In the sensor example, the interrupt assignment for the original circuit board revision might be represented by the following devicetree property:

int-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;

This property describes the GPIO controller, pin number, and electrical polarity of the interrupt signal.

The device driver obtains its hardware configuration from the devicetree rather than relying on a pin assignment embedded in its implementation. Consequently, the driver and application software can remain unchanged when the interrupt moves to a different processor pin.

This separation establishes an important architectural boundary. The application defines what the product does, while the devicetree describes the hardware resources through which those functions are performed.

Zephyr Devicetree Documentation

Representing hardware revisions as configuration variants

Zephyr extends this separation through its support for multiple revisions of a custom board.

Hardware revisions can be formally identified in the board’s metadata, allowing the build system to distinguish between different physical implementations of the same electronic product.

A board definition supporting two letter-based hardware revisions might contain the following revision metadata in its board.yml file:

revision:
  format: letter
  default: A
  exact: true
  revisions:
    - name: A
    - name: B

This configuration establishes two recognized hardware revisions, with revision A serving as the default. Exact revision matching prevents the build system from silently substituting another supported revision when an unrecognized revision is explicitly requested.

Differences between hardware revisions can then be represented using revision-specific devicetree overlays.

For the revised sensor board, the overlay associated with revision B contains the modified interrupt assignment:

&sensor {
    int-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
};

The remainder of the hardware description is inherited from the common board definition.

This approach allows the configuration difference to be represented as a discrete, reviewable change rather than requiring an entirely separate description of the circuit board.

The application software and device driver remain common to both hardware revisions. Only the hardware configuration supplied to the build system changes.

Zephyr Board Revision Support

Hardware revision management is software configuration management

One of the more significant advantages of Zephyr’s board revision framework is that the hardware revision becomes an explicit part of the software build configuration.

For an illustrative nRF54L15-based custom board, the two hardware revisions can be represented by distinct Zephyr board targets:

Hardware revision Board target
Rev A my_custom_board@A/nrf54l15/cpuapp
Rev B my_custom_board@B/nrf54l15/cpuapp

Both targets can reference the same application source code, device drivers, and underlying software architecture while producing firmware images appropriate for their respective hardware configurations.

This distinction has implications beyond the immediate development effort. It allows hardware revision compatibility to become part of the broader software configuration management process, including:

A correction to the measurement algorithm, for example, can be incorporated into the common application software and subsequently built and evaluated against each supported hardware revision.

There is no inherent requirement to maintain a separate application software branch for every circuit board revision.

Zephyr Board Target Terminology

Establishing traceability between hardware and firmware

An important consideration in managing multiple hardware revisions is establishing confidence that a particular firmware image corresponds to the intended electrical design.

Zephyr’s build process produces a resolved devicetree, commonly available as zephyr.dts, representing the effective hardware description used to build the application image.

Unlike the individual devicetree source files and overlays, this generated representation reflects the combined hardware configuration after the applicable descriptions and overlays have been processed.

It provides a useful engineering artifact for evaluating the relationship between the electrical design and the resulting firmware configuration.

However, a correct devicetree does not, by itself, establish that the corresponding physical hardware operates as intended. Electrical verification, firmware integration, and functional testing remain necessary to establish compatibility.

Similarly, Zephyr’s revision framework does not automatically determine which physical hardware revision is being programmed. The relationship between a firmware image and its intended hardware revision must be maintained through the product’s manufacturing, release, and service processes.

Where firmware must be distributed across a population of devices containing multiple hardware revisions, additional architectural considerations may include hardware identification, bootloader compatibility, and revision-aware firmware distribution.

These considerations become particularly important for products that support field firmware updates.

Zephyr Devicetree Build Outputs

Recognizing the limits of hardware abstraction

Not every hardware revision can be accommodated through a devicetree overlay.

Changes to GPIO assignments, interrupt signals, peripheral interfaces, and certain device configuration parameters are natural candidates for representation within the devicetree.

More substantial changes may introduce different device drivers, alternative communication protocols, modified power-management behavior, or changes to the functional capabilities of the product.

Some differences may be addressed through revision-specific software configuration using Zephyr’s Kconfig framework. Others may require additional hardware abstraction or changes to the application architecture.

The engineering challenge is determining which differences represent hardware configuration, which represent software configuration, and which constitute changes to the underlying product functionality.

Maintaining this distinction helps prevent hardware-specific implementation details from propagating unnecessarily throughout the software architecture.

It also establishes a more manageable foundation for supporting future product variants and hardware revisions.

The commercial significance of configuration management

The cost of supporting multiple hardware revisions is not limited to the engineering effort associated with implementing each change.

Every independently maintained software branch potentially introduces additional integration, verification, release management, documentation, and maintenance obligations.

For medical and industrial electronic products, where equipment may remain in production or service for many years, these obligations can accumulate substantially over the product’s lifecycle.

A well-structured configuration management architecture allows engineering teams to maintain common application functionality while explicitly managing the differences between supported hardware configurations.

Although each applicable hardware and software configuration still requires appropriate verification, reducing unnecessary software divergence can help contain the complexity and cost of maintaining the product.

The benefits of this architecture become increasingly significant as the product evolves beyond its initial release.

Conclusion

Managing hardware revisions is fundamentally a system architecture and configuration management problem rather than simply a matter of changing processor pin assignments. Zephyr’s board revision framework, devicetree architecture, and software configuration mechanisms provide a foundation for representing hardware differences without unnecessarily fragmenting the application software. Their effectiveness, however, depends on how the boundaries between electrical design, device configuration, application behavior, and product requirements are established and maintained.

At Wolff Electronic Design, we consider hardware evolution and software maintainability integral aspects of electronic product development. By addressing these considerations during the initial system architecture, we seek to reduce the long-term engineering and verification costs associated with hardware revisions, component obsolescence, product variants, and continued product support.