Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:vim4:configurations:device-tree-overlay

This is an old revision of the document!


Device Tree Overlay

Introduction

You can use Device Tree Overlay feature to enable/disable some hardware functions without to recompile the kernel source code.

Install DTBO Debian Package

Make Your Own DTBO Files

There are some ready to use dtbo files, you can also add your own dtbos to enable or disable the peripherals.

khadas@Khadas:~$ ll /boot/dtb/overlays/kvim3
  • Write your own device tree overlay file, for example `example.dts`:
    /dts-v1/;
    /plugin/;
    
    / {
        fragment@0 {
            target = <&i2c3>;
    
            __overlay__ {
                status = "okay";
            };
        };
    };

This device tree overlay is to enable `i2c3`.

  • Compile it to dtbo
    khadas@Khadas:~$ dtc -I dts -O dtb -o example.dtbo example.dts
    khadas@Khadas:~$ ls example.dtbo
    example.dtbo
  • Move the dtbo file to /boot/dtb/overlays/kvim3
  • Edit /boot/env.txt to add in node overlays
  • Reboot the board
Last modified: 2022/07/06 02:48 by nick