🛠 Overlays device tree sur Le Potato : activer I2C, PWM, SPI
Objectives
Understand why the I2C, PWM, and SPI interfaces on the 40-pin connector are disabled by default on the Le Potato, and how to properly enable them using device tree overlays — the board is "mainline-first": everything goes through the upstream device tree (meson-gxl-s905x-libretech-cc.dts in the kernel).
Hardware
- Le Potato AML-S905X-CC running Armbian (current/edge mainline kernel)
- Knowledge of device trees; the device-tree-compiler package for custom overlays
Complete code
# 1) Voie recommandee : menus Armbian
sudo armbian-config # System > Options > HW interfaces : I2C / SPI / PWM
# ou edition directe du fichier de config :
sudo nano /boot/armbianEnv.txt
# overlays="i2c0 i2c1" # noms exacts : ls /boot/dtb/overlay/
sudo reboot
# 2) Verifier le device tree effectif
cat /proc/device-tree/compatible
# -> libretech,aml-s905x-cc amlogic,s905x amlogic,meson-gxl
ls /dev/i2c-* /dev/spidev* 2>/dev/null
sudo i2cdetect -l
# 3) Overlay maison minimal (exemple d'activation d'un bus I2C)
cat > i2c-ajout.dts <<'EOF'
/dts-v1/;
/plugin/;
&i2c_ao { status = "okay"; };
EOF
sudo dtc -@ -I dts -O dtb -o /boot/dtb/overlay/i2c-ajout.dtbo i2c-ajout.dts
Expected verification
After rebooting, /dev/i2c-N appears and i2cdetect -y N responds; /proc/device-tree reflects the enabled node. Available overlays are listed in /boot/dtb/overlay/ and loaded ones are specified in armbianEnv.txt.
Common errors
- Looking for a config.txt like on Raspberry Pi: here it is armbianEnv.txt/armbian-config, and the mainline DTS is named meson-gxl-s905x-libretech-cc.dts (not "libre-tech-potato").
- Compiling an overlay without the
-@option (symbol table): the plugin does not graft onto the parent node. - Inventing overlay names: use exactly the files present in /boot/dtb/overlay/.
- Forgetting to reboot: overlays do not reload hot.
Other tutorials for this board
- Faire clignoter une LED en C avec libgpiod sur Le Potato
- Lire un bouton poussoir avec libgpiod (pull-up interne)
- GPIO en Python avec python3-libgpiod sur Le Potato
- Fondu LED progressif avec PWM sous sysfs (meson)
- Capteur BME280 (I2C) sur Le Potato : overlay et lecture
- Console série (ttyAML0) et SSH sur Le Potato
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash