Day04 - Device Tree Overlay¶
Objective¶
- Understand how to create a Device Tree Overlay
- Compile
.dtsinto.dtbo - Load overlay dynamically on Raspberry Pi
Environment¶
- Board: Raspberry Pi 5
- OS: Debian (Raspberry Pi OS Lite)
- Architecture: arm64
Step 1 — Create DTS File¶
Create a file:
Example content:
fragment@0 { target-path = "/";__overlay__ {
test_device {
compatible = "test,device";
status = "okay";
};
};
};
};
Step 2 — Compile Device Tree Overlay¶
Step 3 — Load Overlay¶
Step 4 — Verify¶
Check kernel logs:
Observations¶
- Overlay can be loaded dynamically without reboot
- Kernel accepts new hardware description at runtime
- No actual driver is bound yet (no
compatiblematch)
Key Learnings¶
- Device Tree describes hardware, not behavior
- Overlay modifies existing Device Tree
compatibleis critical for driver matching
Common Issues¶
1. dtc not found¶
Install:
2. Overlay not applied¶
Check:
Next Step¶
- Bind Device Tree to a real driver
- Explore platform driver model