Installing Debian ARM64 on Raspberry Pi 3 with WiFi
Most users are probably using Raspbian on their Raspberry Pi 3. However, Raspbian is designed for all Raspberry Pi devices, back to the original Raspberry Pi, which is ARMv6 with an FPU. This does not take advantage of the 64-bit support on the ARMv8 CPU on the Raspberry Pi 3.
Debian has offered ARM64 support for a while, and being the base distribution for Raspbian, is quite similar. Conveniently, there is a pre-built Debian image for Raspberry Pi 3. You can download it and copy it to a SD card, and it should work out of the box.
On Linux, the simple dd
command showed on the Debian Wiki works. On other platforms, notably Windows, Etcher is reputed to work well and has an easy interface.
The one flaw with this image is that the WiFi does not work.
Update: The 20180108 image now works with WiFi out of the box. The following instructions are no longer necessary.
To make WiFi work, you will have to recompile the kernel. You can follow the instruction below to cross compile the kernel on amd64, or you can use my .deb
package of a kernel that works with the WiFi chip on the Raspberry Pi. You are suggested to build your own kernel, however, so that you can have full confidence in its authenticity.
In any case, you have get the linux-image
file, which is linux-image-4.13.0-1-arm64_4.13.4-2_arm64.deb
in this case, somehow, onto your Raspberry Pi, and you can run the following command to install the kernel and reboot:
dpkg -i linux-image-4.13.0-1-arm64_4.13.4-2_arm64.deb
Detailed instructions to build Debian kernel 4.13.4-2 for arm64
The basic idea of cross compiling the kernel can be found on the Debian Wiki. You will just have to add CONFIG_BRCMFMAC_SDIO=y
to debian/config/arm64/config
before the make setup
step.
This is an example that you can adapt to your own needs:
sudo apt install fakeroot git kernel-wedge quilt ccache crossbuild-essential-arm64
mkdir ~/build-kernel
cd ~/build-kernel
wget https://cdn-aws.deb.debian.org/debian/pool/main/l/linux/linux_4.13.4.orig.tar.xz
git clone -n https://anonscm.debian.org/git/kernel/linux.git debian-kernel
cd debian-kernel
git checkout -b buster debian/4.13.4-2
export $(dpkg-architecture -aarm64)
export PATH=/usr/lib/ccache:$PATH
export DEB_BUILD_PROFILES="nopython nodoc pkg.linux.notools"
export MAKEFLAGS="-j$(($(nproc)*2))"
fakeroot make -f debian/rules clean
fakeroot make -f debian/rules orig
fakeroot make -f debian/rules source
echo CONFIG_BRCMFMAC_SDIO=y >> debian/config/arm64/config
fakeroot make -f debian/rules.gen setup_arm64
fakeroot make -f debian/rules.gen binary-arch_arm64
The completed .deb
package can be found in ~/build-kernel/linux-image-4.13.0-1-arm64-dbg_4.13.4-2_arm64.deb
.
Firmware
The image is also missing the firmware file brcm/brcmfmac43430-sdio.txt
. This file can be obtained from Raspbian. You can download the .deb
file for firmware-brcm80211 and extract /lib/firmware/brcm/brcmfmac43430-sdio.txt
and put it onto your Debian install.
The following command downloads this file for your convenience:
wget https://dl.quantum2.xyz/rpi3/brcmfmac43430-sdio.txt -O /lib/firmware/brcm/brcmfmac43430-sdio.txt
Reboot and WiFi should work. Try iwlist wlan0 scan
. Happy hacking!