Using WaveShare / SainSmart 3.2 inch RPi LCD whit RPi 3

I brought a WaveShare / SainSmart 3.2 inch RPi LCD

I’ve followed this instructions with some modification:

Using raspbian 2016/03/18

http://hardware-libre.fr/2015/07/review-guide-waveshare-sainsmart-3-2-inch-rpi-lcd/

fbtft module entered into staging using it vi

add fbtft into /et/modules

cd /tmp
git clone https://github.com/swkim01/waveshare-dtoverlays.git
sudo cp waveshare-dtoverlays/*.dtb /boot/overlays/

/etc/udev/rules.d/touchscreen.rules

SUBSYSTEM==”input”, KERNEL==”event[0-9]*”, ATTRS{name}==”ADS7846*”, SYMLINK+=”input/touchscreen”
SUBSYSTEM==”input”, ATTRS{name}==”stmpe-ts”, ENV{DEVNAME}==”*event*”, SYMLINK+=”input/touchscreen”

 

Debian sur raspberry pi (non rasbian)

Configuration debian pour raspberry pi:

Installation des outils selon rapsberry pi:

crossbuild-essential-armel
crossbuild-essential-armhf
crossbuild-essential-arm64

creation partition:

16M en fat16 pour uboot
Le reste pour le systeme

Mount /dev/{device}p2 /mnt

Creation filesystems selon rapsberry pi:

qemu-debootstrap –variant=minbase –arch=armel buster /mnt/ http://ftp.fr.debian.org/debian/
qemu-debootstrap –variant=minbase –arch=armhf buster /mnt/ http://ftp.fr.debian.org/debian/
qemu-debootstrap –variant=minbase –arch=arm64 buster /mnt/ http://ftp.fr.debian.org/debian/

mount –bind /dev /mnt/dev
mount –bind /proc /mnt/proc
mount –bind /sys /mnt/sys

mkdir boot/uboot

chroot /mnt

Instalation selon rapsberry pi:

apt update; apt install linux-image-4.19.0-5-rpi sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi
apt update; apt install linux-image-4.19.0-5-armmp sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi
apt update; apt install linux-image-4.19.0-5-arm64 sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi

mount /dev/sdd1 boot/uboot/
cd boot/uboot/

Copie des fichiers du firmware du GPU:

wget https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_x.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_db.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_cd.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_x.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_db.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_cd.elf

Copie uboot selon rapsberry pi:
cp /usr/lib/u-boot/rpi/u-boot.bin .
cp /usr/lib/u-boot/rpi_2/u-boot.bin .
cp /usr/lib/u-boot/rpi_3_32b/u-boot.bin .
cp /usr/lib/u-boot/rpi_3/u-boot.bin .

Configuration flash-kernel selon rapsberry pi:
echo “Raspberry Pi 1 Model A” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model A+” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B+” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B Rev2” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Compute Module” > /etc/flash-kernel/machine
echo “Raspberry Pi Model B V2” > /etc/flash-kernel/machine
echo “Raspberry Pi Model Zero” > /etc/flash-kernel/machine
echo “Raspberry Pi Model Zero W” > /etc/flash-kernel/machine
echo “Raspberry Pi 2 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 3 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 3 Model B+” > /etc/flash-kernel/machine

Relance de flash-kernel apres configuration:
flash-kernel

Modification de fichier:
cat << EOF > /etc/fstab
# /etc/fstab: static file system information.
#
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# # / was on /dev/mmcblk0p2 during installation
UUID= / ext4 errors=remount-ro 0 1
# /boot/uboot was on /dev/mmcblk0p1 during installation
UUID= /boot/uboot vfat utf8 0 0
tmpfs /tmp tmpfs defaults,size=200M 0 0
tmpfs /var/tmp tmpfs defaults,size=200M 0 0
EOF

echo “raspberrypi” > /etc/hostname

cat << EOF > /etc/hosts
127.0.0.1 localhost raspberrypi

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF

cat << EOF > /etc/network/interface
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
EOF

cat << EOF > /etc/default/locale
# File generated by update-locale
LANG=fr_FR.UTF-8
EOF

cat << EOF > /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free

# stretch-updates, previously known as ‘volatile’
deb http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free

deb http://ftp.fr.debian.org/debian buster-backports main contrib non-free
deb-src http://ftp.fr.debian.org/debian buster-backports main contrib non-free
EOF

adduser
usermod -G sudo -a

cat << EOF >/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# # program, run by the persistent-net-generator.rules rules file.
# #
# # You can modify it, as long as you keep each rule on a single
# # line, and change only the value of the NAME= key.

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”“, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
EOF

update-initramfs -u

ajout 64 bits (pi3 non tester):

arm_control=0x200

Debian jessie for Banana Pi

To install Debian jessie on Banana Pi you need:

– Computer with GNU/Linux OS with network access
– Card reader
– Memory card with 2GB or more space
– Banana Pi with network access
– 3,3V serial to USB converter

Go to www.debian.org website and choose network installation with armhf,
Now on http://ftp.nl.debian.org/debian/dists/jessie/main/installer-armhf/current/images/,
save/open in new tab SHA256SUMS to check the files bellow
Go to netboot directory and SD-card-images and download:
– firmware.BananaPi.img.gz
– partition.img.gz
Check with sha256sums and compare with the SHA256SUMS file

According the README.concatenateable_images file use :
zcat firmware..img.gz partition.img.gz > complete_image.img

Copy ‘complete_image.img’ to sdcard with dd:
sudo dd if=complete_image.img of=(path of sdcard) bs=8K

Connect the serial adapter and insert the sdcard into the Banana Pi and plug the power, you will see the installer booting into your terminal,
Installer work like x86 installer juste be carefull with the ‘hard disk partitionning’ you can safely remove the FAT partition and take the whole to ext4 partition because the uboot bootloader is between sector 0 and 2047 but dont erase these sectors.