Solved FreeBSD wont' boot on RPI 4 4B (8GB RAM)

I got this running on the 4GB model and was running fine until the the USB-C port got dislodged. I bought an 8 GB model to replace it and I can't get past the rainbow screen. I tried several different sd cards, and then tried an Ubuntu image and a Raspbian image just to make sure it was not my device. It seems to run flawlessly, but will not boot the 13.0-RELEASE image. I tried the nightly builds of 13.0-STABLE as well.
Images tried:
FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img
FreeBSD-13.0-STABLE-arm64-aarch64-RPI-20210819-60833696c2e-246841.img
 
For the record:

Just tried it (tested with Raspberry Pi 400).

There's no need to download the u-boot.bin from https://sourceforge.net/projects/fbsd-u-boot-2021-04-apr18-2021/files/u-boot.bin/download anymore, the one in the package repository works too. sysutils/u-boot-rpi4 - be sure to get at least 2021.04 or later.

I found another trick: If you have a spare USB pen drive, just dd it with the same FreeBSD image as the SD card, plug both in and the Raspberry will magically boot from the SD!
You then can pkg install u-boot-rpi4 on the Raspi and copy the file in the already mounted msdos partition:
cp /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin /boot/msdos/

Be sure to use quarterly packages since latest are too old and won't work.
ABIlatestquarterly
FreeBSD:13:aarch642020.102021.04

WTF? Why are latest older than quarterly?



Edit: In case you wonder why i used the pen drive to boot the SD card rather than just putting the card in a reader and mount it there: I don't have a SD card reader.

For the laughs: My o(d)dyssey to install FreeBSD without an SD card reader:

Items available: Raspberry Pi 400, 1 SD card with shipped Raspi OS (16GB), 1 spare SD card (32GB), 1 USB pen drive (4GB).

- Use Raspberry Pi OS to dd FreeBSD to the pen drive
- First, lets do a freebsd-update fetch install. Ooops, only 600MB free space left on the pen drive. Can't do much with it.
- Ok, lets fetch another FreeBSD image from within the FreeBSD on the pen drive in order to put it on the SD card
- lots of ssl key errors need to be resolved
- Finally, i got an image. Try to dd it to the internal SD card slot
- Use /dev/da0 at first since it's the device you see in all the tutorials.
- After 2 hours of dd running i realized it's the pen drive i wanted to overwrite with the image rather than the SD card. Bummer!
- Read up on Raspberry devices and try /dev/mmc. No luck, no /dev/mmc devices present when booting from pen drive
- Need another plan
- Linux to the rescue!
- Use shipped Raspberry Pi OS to install tinyCore Linux on the pen drive
- I used tinyCore since Raspberry Pi OS doesn't run well from my pen drive. Lots of ext4 errors after a while.
- Use tinyCore to fetch and dd the FreeBSD image to the spare SD card using the internal SD card slot. It worked!
- Didn't want to download files from Stackoverflow, so i need a working FreeBSD installation now:
- Use Raspberry Pi OS to dd the pen drive with FreeBSD - again
- Again trying to mount the SD card from the Freebsd running from the pen drive - no luck, no /dev/mmc devices present
- * after HOURS of try n error *
- Accidentally have both plugged in while booting and realized (pkg wanted to bootstrap again), the Pi has booted from the SD!
- Profit!

Was a lot of fun but i got two more gray hairs!

Configuring X is another story for another thread! Spoiler: You need to edit /boot/msdos/config.txt
 
There's no need to download the u-boot.bin from https://sourceforge.net/projects/fbsd-u-boot-2021-04-apr18-2021/files/u-boot.bin/download anymore, the one in the package repository works too. sysutils/u-boot-rpi4 - be sure to get at least 2021.04 or later.
That's actually where I ended up getting it. I have an old laptop running FreeBSD x86_64, installed u-boot-rpi4 and copied the file over (using an sdcard to usb adapter). You should write up a blog post on your adventure!
 
BTW, also for posterity's sake, I've learned that FreeBSD on the Raspberry Pi 4 will not boot if the HDMI connector is being used closest to the barrel power supply. Just stays on the rainbow screen. Switch HDMI ports and all is well. This was a bug with earlier versions of Raspbian as well. That added to my earlier confusion.
 
Back
Top