« Cohabitation écran Adafruit PiTFT 2.8" et HDMI » : différence entre les versions

De knowledge
Aller à la navigation Aller à la recherche
mAucun résumé des modifications
mAucun résumé des modifications
Ligne 14 : Ligne 14 :
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="text">
<syntaxhighlight lang="ini">
# /boot/cmdline.txt
# /boot/cmdline.txt
console=tty1 fbcon=map:10
console=tty1 fbcon=map:10
Ligne 28 : Ligne 28 :
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="text">
<syntaxhighlight lang="ini">
# /boot/cmdline.txt
# /boot/cmdline.txt
console=tty1 fbcon=map:0
console=tty1 fbcon=map:0

Version du 10 octobre 2025 à 20:54

Configuration écran Adafruit PiTFT 2.8" et HDMI sur Raspberry Pi

Contexte

Le Raspberry Pi gère plusieurs framebuffers :

  • /dev/fb0 : sortie HDMI
  • /dev/fb1 : écran PiTFT

Par défaut, la console s'affiche sur fb0. L'installation du PiTFT peut rediriger la console vers fb1, rendant l'écran HDMI noir.

Méthode 1 : Console sur PiTFT

# /boot/config.txt
dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20
# /boot/cmdline.txt
console=tty1 fbcon=map:10

Méthode 2 : Console sur HDMI

# /boot/config.txt
#dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=82
# /boot/cmdline.txt
console=tty1 fbcon=map:0

Méthode 3 : Multi-console (switch avec Ctrl+Alt+Fn)

Permet d'afficher :

  • tty1 sur PiTFT
  • tty12 sur HDMI

Script de mappage framebuffer

sudo nano /etc/init.d/fbmap.sh

Contenu :

#!/bin/bash
con2fbmap 1 1   # tty1 → fb1
con2fbmap 12 0  # tty12 → fb0

Activation :

sudo chmod +x /etc/init.d/fbmap.sh
sudo update-rc.d fbmap.sh defaults

Bascule clavier

  • Ctrl+Alt+F1 → PiTFT
  • Ctrl+Alt+F12 → HDMI

Test rapide

cp /dev/random /dev/fb0  # bruit sur HDMI
cp /dev/random /dev/fb1  # bruit sur PiTFT

Notes

  • Le mappage fbcon=map:X est global. Pour un contrôle fin, utiliser con2fbmap.
  • X11 peut être configuré pour s'afficher sur un framebuffer spécifique via xorg.conf.

Voir aussi