Skip to content

Wire a Driver into perovsat-app

Updated: 9/29/26

This guide covers the integration of a new device into the DBuild system.

Prerequisites

Overview

Integration requires three areas of work:

  1. Register the driver west project in west.yml
  2. Create a snippet per supported backend mode
  3. Add the logical device to dbuild.yml, linking to the correct snippets

The MPU6050 / IMU setup in perovsat-app is the reference.

Create snippets

Create one directory per mode under snippets/

Each snippet needs:

  1. snippet.yml — registers conf and overlay files
  2. .conf — enables the driver and any bus emulation options
  3. .overlay — instantiates the device and sets the application alias

Look at the other existing snippets for examples or see DBuild snippets for snippet.yml structure.

If you want, you can create a DeviceTree alias in the .overlay file(s)

Register in dbuild.yml

Add the device under devices with a kconfig_backend per mode, and add an entry to selections

Backend symbol names must match the driver's Kconfig choice block exactly.

Fetch the device in application code

const struct device *imu = DEVICE_DT_GET(mpu6050);
const struct device *imu = DEVICE_DT_GET(DT_ALIAS(imu)); // With alias

Verify

Preview the resolved build:

west dbuild -b mps2/an521/cpu0 --dry-run

Confirm:

  • Your snippet appears in the -S list
  • The expected CONFIG_PEROVSAT_<CHIP>_BACKEND_<MODE>=y symbol is set
  • No west-project or board-overlay validation errors