Contents
FreeBSD/ARM on the Raspberry Pi family
What is Raspberry Pi?
The original Raspberry Pi launched in early 2012 as an inexpensive ($35) PC based on a Broadcom BCM2835 SoC. It was developed by the UK-based Raspberry Pi foundation as an inexpensive system for educational use. As of April 2013, it had sold over a million units.
There are many versions of the Raspberry Pi. Where links are shown, they lead to information about models currently being sold.
Due to the bewildering number of versions, some earlier versions are not listed here.
- The original "Model B" includes Ethernet, 2 USB ports and originally included 256MB RAM. First shipped in Feb 2012. Can be identified by the lack of mounting holes and "(c) 2011" on the board
- After late 2012, "Model B" was updated with 512MB RAM. This version can be identified by the two mounting holes and "(c) 2011,2012" on the board.
"Model A" was released in early 2013. It lacks Ethernet, has only one USB port, 256MB RAM and is somewhat cheaper than the Model B.
The "Model B+" released in July 2014 has 4 USB ports, micro SD, lower power consumption, more GPIO pins and 512MB RAM.
- The Raspberry Pi 2 released in February 2015 has 4 USB ports, micro SD slot, a new 900 MHz quad-core ARM Cortex-A7 CPU, 1GB RAM and complete compatibility with Raspberry Pi 1.
- The Raspberry Pi 3 uses the BCM2837 SoC, quad-core 1.2GHz ARM Cortex-A53,1GB LPDDR2 SDRAM, 10/100 Ethernet (via USB).
The Raspberry Pi 2 v1.2 uses the same SoC as the Raspberry Pi 3 rather than the SoC from earlier Raspberry Pi 2 models.
The Raspberry Pi 3B+/Pi 3A+ use the BCM2837B0 SoC , 1.4GHz 64-bit quad-core A53 (ARMv8) processor, 1GB/512MB LPDDR2 SDRAM, Gigabit Ethernet (via USB channel, maximum throughput of 300Mb/s)/No Ethernet (A+ model).
The Raspberry Pi 4 uses the BCM2711 SoC (a re-implementation of BCM283X on 28nm), 1.5GHz quad-core 64-bit ARM Cortex-A72 (ARMv8) processor, 1 (no longer sold), 2, 4, or 8GB of LPDDR4 SDRAM, full-throughput Gigabit Ethernet, dual-band 802.11ac wireless, two USB 3.0 and two USB 2.0 ports, dual 4K monitor support, VideoCore VI graphics, 4Kp60 HEVC video hardware decoding, USB-C power.
The Raspberry Pi 400 is a modified RPI4 built into a keyboard
The Raspberry Pi Hardware and Raspberry Pi revision codes pages have much more detailed information about models.
Raspberry Pi and FreeBSD
FreeBSD has supported the original Raspberry Pi since November, 2012 and Raspberry Pi 2 since March, 2015.
If you have questions, please ask on the freebsd-arm@ mailing list.
Xorg
How to Boot the Raspberry Pi
As of January 2013, FreeBSD-CURRENT fully supports either a video console (you'll need a USB keyboard and display connected) or it can be configured to use a serial console (you'll need a USB to TTL Serial Cable such as the one sold by Adafruit.com). OTG-capable boards, such as Zero, provide virtual serial console when connected to an USB host.
After connecting video, keyboard, and inserting the SDHC card, you connect power to actually boot.
Pre-Built Images
Version |
ARCH |
Releases |
Snapshots |
RPI-B |
armv6 (all) |
||
RPI2 |
armv6 (12+), armv7 (12+) |
||
RPI3 |
aarch64 (12) |
||
RPI |
aarch64 (13+) |
For Raspberry Pi Zero use the image for RPI-B. For Raspberry Pi 3, Pi 4 and Pi 400 use the image for RPI on 13+.
The default passwords for the images are freebsd/freebsd and root/root .
How to Build Your Own Images
Raspberry Pi and Raspberry Pi 2 are supported by the Crochet build tool.
Building an image for Raspberry Pi 2
DTB Overlays
These are a recent feature. Please see this README for more information.
Features
What works
|
RPi 1 |
RPi 2 |
RPi 3 / RPi 3B+ / RPi 2 1.2 |
RPi 4 |
RPi Zero |
RPi Zero W |
Wordsize |
32 |
32 |
64 |
64 |
32 |
32 |
audio |
OK |
OK |
? |
Currently unsupported |
Not avail. |
Not avail. |
camera |
Not Tested |
OK |
? |
? |
? |
|
ethernet |
OK |
OK |
OK |
Not avail. |
Not avail. |
|
GPIO |
OK |
OK |
OK |
OK |
OK |
|
HDMI |
OK |
OK |
OK |
OK (max. 1080p/scfb) |
OK |
OK |
i2c |
OK |
OK |
? |
OK (brcm BSC) |
OK (12+ needs dt config) |
OK (12+ needs dt config) |
SD card |
OK |
OK |
OK |
OK |
OK |
OK |
SMP |
Not avail. |
OK |
OK |
OK |
Not avail. |
Not avail. |
SPI |
OK |
OK |
? |
OK |
OK |
OK |
USB 2.0 |
OK |
OK |
OK |
OK (both device and host) |
OK (both device and host) |
|
watchdog |
OK |
OK |
? |
OK |
? |
|
UEFI/ACPI |
- |
- |
? |
|
||
|
|
Unsupported (BCM43438 Driver) |
Unsupported (brcmfmac43455-sdio) |
Not avail. |
Unsupported (BCM43438 Driver) |
|
TV Hat |
? |
? |
? |
? |
? |
? |
GPIO
Perl, Python and Ruby wrappers for interfacing with the GPIO ioctl are available at https://github.com/brd/freebsd-gpio
Camera
External Displays
Some external displays made for the Raspberry Pi require extra configuration steps to work properly. The Raspberry Pi uses a config.txt file on a FAT partition instead of a traditional BIOS or UEFI firmware. Manufacturers of displays built for Raspberry Pis may provide the relevant settings as part of the documetation. The settings are often the same as on Linux-based distributions for the Raspberry Pi. After writing the bootable image to the compact flash card, mount the FAT partition contained on it as msdosfs and open the config.txt file. This can also be done from within the Pi itself, provided the display gives some form of output, otherwise another machine has to be used. The partition is mounted like this after logging in:
/dev/msdosfs/MSDOSBOOT on /boot/msdos (msdos, local, noatime)
A couple of lines are already present in /boot/msdos/config.txt. The lines from the manufacturer have to be added to the end of that file. After saving and exiting the editor, reboot the Raspberry. The updated config.txt file will be loaded and the display should work as expected.
For example, the following lines were added to config.txt to make a 5" touchscreen display from Waveshare work and use the proper resolution:
max_usb_current=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 800 480 60 6 0 0 0 hdmi_drive=1
And the following lines were added to config.txt to make a 9" display from Beetronics work and use the proper resolution:
max_usb_current=1 hdmi_group=2 hdmi_mode=69 hdmi_drive=1
Pi-Top
The Pi-Top is a cheap laptop built around the Rpi3
To get the touchpad working add this to your /boot/loader.conf:
usb_quirk_load=YES ums_load=YES hw.usb.quirk="0x258a 0x000c 0x0000 0xffff UQ_CFG_INDEX_1"
Device Configuration
Device Trees, overlays, and parameters
SDIO
SDIO is implemented in r348805 and we should tether brcmfmac43455-sdio.bin / brcmfmac43455-sdio.txt to get first WIFI network for the RPI4 .
RPi3 Notes
Booting from a USB connected hard disk - see Bob Prohaska's notes (The hard disk is powered from a powered USB hub.) and Raspberry Pi Boot Modes.
RPI4 and RPi400 Notes
The RPi4 and RPi400 idle at 600MHz but support 1500MHz and 1800MHz respectively.
To enable automatic CPU with powerd(8):
sysctl dev.cpu.0.freq dev.cpu.0.freq: 600 sysrc powerd_enable="YES" /etc/rc.d/powerd restart
If the display defaults to 592x448 under xorg, modify the file /boot/msdos/config.txt with:
hdmi_safe=0
or simply comment out "hdmi_safe=1"
The following additional config.txt setting maybe required, depending on the brand and/or model of monitor used:
max_framebuffers=2 hdmi_force_hotplug=1 hdmi_group=1 hdmi_drive=2 hdmi_mode=16
The FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img image is known to work with xorg, XFCE, Firefox, and other popular desktop applications. The mouse daemon will start automatically and need not be enabled.
Known RPi 4 Issues
Boot Loader Issues
RPi 4 Rev >= 1.2 doesn't boot with FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img image.
The u-boot.bin used when creating 13.0-RELEASE image was too old to support newer RPi4 hardware revision.
The workaround is replacing u-boot.bin with newer one from sysutils/u-boot-rpi4:
# pkg install -y u-boot-rpi4 # mdconfig -f FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img md0 # mount_msdosfs /dev/md0s1 /mnt cp /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin /mnt/u-boot.bin # umount /mnt mdconfig -d -u 0
Reference: How to Check if Your Raspberry Pi 4 Model B is Rev1.2?
Console output on HDMI
If the HDMI/Micro HDMI display port shows the RPi rainbow color screen rather than console output, try the other port.