RPi 4 not booting even after u-boot.bin is replaced

I have a RPi 4B with 8GB of RAM which I bought in 2021. I've updated its bootloader last year because the Raspberry Pi OS 64 Bullseye didn't boot but after updating it didn't boot either so I gave up.
I'm trying to install FreeBSD 13.1 on it but it just shows a screen full of different colors and that's it.
I followed the wiki arm/Raspberry Pi::Known RPi 4 Issues (using my RPi 3), replaced u-boot.bin but it didn't work.
Then I compiled U-Boot by myself and replaced the u-boot.bin but it didn't work either.
I updated it's bootloader using RPiImager again but it didn't work either.
I install an old bootloader(version rpi-boot-eeprom-recovery-2020-09-03-vl805-000138a1-imager, the oldest for the imager on GitHub) but it didn't work either.

So now I don't know what to do. Can anyone help me?
Thank you.
 
I updated it's bootloader using RPiImager again but it didn't work either.
I install an old bootloader(version rpi-boot-eeprom-recovery-2020-09-03-vl805-000138a1-imager, the oldest for the imager on GitHub) but it didn't work either.
None of this is needed for FreeBSD and could be the cause of your problem.

Here is what I advise. Take the u-boot that you built and test it.
Place the u-boot file onto a FAT32 formatted partition on your microSD card.
Try to boot it up and go into u-boot console.
You don't need any OS just u-boot.
That will test your u-boot bootloader built on FreeBSD.
 
  • Thanks
Reactions: swt
  • Thanks
Reactions: swt
None of this is needed for FreeBSD and could be the cause of your problem.

Here is what I advise. Take the u-boot that you built and test it.
Place the u-boot file onto a FAT32 formatted partition on your microSD card.
Try to boot it up and go into u-boot console.
You don't need any OS just u-boot.
That will test your u-boot bootloader built on FreeBSD.
I tried putting the u-boot.bin(first the one built by me, then the one from the port) into a blank FAT32 microSD and booting the RPi4 with it, but neither worked.
It shows:
...
recovery4.elf not found (6)
recovery.elf not found (6)
start4.elf not found (6)
start.elf not found (6)
firmware not found
ERROR: 00000004
 
I looked at the wiki and its no so definative. Here is what I would do.

Download and extract this image:

Write image to microSD card with FreeBSD's dd command.

Install u-boot port for rpi4:
pkg install u-boot-rpi4

Copy the u-boot file /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin onto the microSD card FAT32 partition.

If any of these steps are unclear just ask.
I did that.

I followed the wiki arm/Raspberry Pi::Known RPi 4 Issues (using my RPi 3), replaced u-boot.bin but it didn't work.
By that, I mean I modified the IMG file and wrote it into the card.
After that failed, I replaced the U-Boot.bin(first with the one from the port then with the one built by me) in the FAT partition but it didn't work either.
 
Have you tried using a UART cable for serial console output?
I have found HDMI to have issues with some monitors.
I tried just now but nothing showed up.
I also tried SSH yesterday but it didn't work either.
The green LED is off and not shining while the screen is colorful, which means the RPi was not doing anything.
 
Just for clearificytion: Are you using an RPi3 or RPi4 now? Are you trying to run binaries/bootloader from the -4 on the -3?
If memory serves me right, the -3 is 32 bits and the -4 is 64. It would be of no surprise that that won't fly.
 
recovery4.elf not found (6)
recovery.elf not found (6)
start4.elf not found (6)
start.elf not found (6)
firmware not found
those file are required
check sysutils/rpi-firmware
 
  • Thanks
Reactions: swt
What does file say to the files on your SD Card? If they are 64 bit binaries, but your uboot is 32 bits, it may fail to load them due to the architecture not being the same. While the RPi3 can run 64 bit, the old rasperian was 32 bits only, so you may have some part in the boot chain not up to task if you try with 64 bit binaries. Just a hunch on my part.[/cmd]
 
  • Thanks
Reactions: swt
Just for clearificytion: Are you using an RPi3 or RPi4 now? Are you trying to run binaries/bootloader from the -4 on the -3?
If memory serves me right, the -3 is 32 bits and the -4 is 64. It would be of no surprise that that won't fly.
I have a 3 and a 4 and I used my 3 to run FreeBSD to modify the card and the image to try to make it able to run on 4.
 
For pi4 the first thing you should do is make sure that RaspberryPi's official Linux os runs. Then if it doesn't run, ask for advice on their forums. This is to make sure that the hardware is running right. It may be that you need the onboard firmware upgraded, or there can be other reasons. Rather than try random things on your own, follow their advice. If you can bring up Raspbian, only then try bringing up FreeBSD.
 
  • Thanks
Reactions: swt
For pi4 the first thing you should do is make sure that RaspberryPi's official Linux os runs. Then if it doesn't run, ask for advice on their forums. This is to make sure that the hardware is running right. It may be that you need the onboard firmware upgraded, or there can be other reasons. Rather than try random things on your own, follow their advice. If you can bring up Raspbian, only then try bringing up FreeBSD.
It was running RPiOS Buster 64 well before I tried to run FreeBSD on it.
It can still run RPiOSBuster64 well now.
 
I would like to help you run FreeBSD on your Raspberry Pi 4B, swt.
Installing FreeBSD from a snapshot image My blogpost with examples. Nice if you comment back there and help me make it better. Welcome to using FreeBSD on a Raspberry Pi 4B.

https://www.freebsd.org/where/ Where to find images to download
https://download.freebsd.org/releas...FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz
If you wish to use cutting edge FreeBSD 14.0-CURRENT , Download from here.
https://download.freebsd.org/snapsh...rch64-RPI-20230120-43703bc489ec-260163.img.xz January 20, 2023 image just last week.

After booting from USB Flash Drive Stick, you can connect ethernet cable from router to RPI 4 ethernet port.
Then attach an external usb to SATA SSD drive and run "bsdinstall" to install FreeBSD to the SSD drive. After setup, shutdown, remove USB Flash Drive Stick, power up and boot from the external usb SSD drive and enjoy FreeBSD on your RPI 4B. Your thoughts?

...
recovery4.elf not found (6)
recovery.elf not found (6)
start4.elf not found (6)
start.elf not found (6)
firmware not found
ERROR: 00000004

Says it could not find a ESP EFI fat32 partition with the boot flag and esp flag set. Where the files: config.txt file start4.elf fixup4.dat u-boot.bin bootcode.bin armstub8.bin armstub8-gic.bin are located.

Make a usb flash drive stick with puppylinux.com fossapup installed. Or if more experienced use Ventoy.net and plus your favorite linux and fossapup there. I suggest fossapup because it has the application GUI "gparted" that you can use to view FreeBSD USB flash drive stick partitions and view SSD partitions in the future.

Use raspi-config to setup Raspberry Pi 4B to boot from a USB flash drive with the eeprom set to something like 0xF41 or 0xF15 . Sorry I have to look and verify in future.
 
I would like to help you run FreeBSD on your Raspberry Pi 4B, swt.
Installing FreeBSD from a snapshot image My blogpost with examples. Nice if you comment back there and help me make it better. Welcome to using FreeBSD on a Raspberry Pi 4B.

https://www.freebsd.org/where/ Where to find images to download
https://download.freebsd.org/releas...FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz
If you wish to use cutting edge FreeBSD 14.0-CURRENT , Download from here.
https://download.freebsd.org/snapsh...rch64-RPI-20230120-43703bc489ec-260163.img.xz January 20, 2023 image just last week.

After booting from USB Flash Drive Stick, you can connect ethernet cable from router to RPI 4 ethernet port.
Then attach an external usb to SATA SSD drive and run "bsdinstall" to install FreeBSD to the SSD drive. After setup, shutdown, remove USB Flash Drive Stick, power up and boot from the external usb SSD drive and enjoy FreeBSD on your RPI 4B. Your thoughts?

...
recovery4.elf not found (6)
recovery.elf not found (6)
start4.elf not found (6)
start.elf not found (6)
firmware not found
ERROR: 00000004

Says it could not find a ESP EFI fat32 partition with the boot flag and esp flag set. Where the files: config.txt file start4.elf fixup4.dat u-boot.bin bootcode.bin armstub8.bin armstub8-gic.bin are located.

Make a usb flash drive stick with puppylinux.com fossapup installed. Or if more experienced use Ventoy.net and plus your favorite linux and fossapup there. I suggest fossapup because it has the application GUI "gparted" that you can use to view FreeBSD USB flash drive stick partitions and view SSD partitions in the future.

Use raspi-config to setup Raspberry Pi 4B to boot from a USB flash drive with the eeprom set to something like 0xF41 or 0xF15 . Sorry I have to look and verify in future.
The "Not Found" errors were displayed when I tried to boot the Pi using a microSD with only a FAT32 partition with only u-boot.bin in it, not the FreeBSD image.

I'll try 14.
 
Everything is messing up. Let me explain what happened.
First, I tried booting the RPi version of FreeBSD on my Pi4 but failed because no matter what I did(replacing u-boot.bin ,updating and downdating bootloader) it just showed a colorful thing which isn't messy. The RPi3 , which can boot the original img successfully, is used to modify the image.

Then, I was suggested to test U-boot and I put the .bin into an empty FAT32 mSD then tried to boot the 4 with it and it threw out the "not found"errors, which has nothing to do with the FreeBSD image.

I'm okay with the default image if it's bootable and I don't want to install it to external SSDs or harddisks.
 
I am sorry if I led you astray by recommending you get u-boot working first.
From my reading RPi4 FreeBSD 13.1-RELEASE image should boot fine.
FreeBSD 13.0 did have issues as you may have read. It required modification to work.
FreeBSD 13-1-RELEASE should work fine now. I say should because I only own RPi3B.

My recommendation on getting u-boot working first was more of a learning exercise.
It is how I would debug booting problems on a RPi4 if I had one.
There are obviously other ways.

I think wb7odyfred suggestions are spot on. You can also use a USB device as he points out.
My only disagreement is FreeBSD-14-CURRENT. I would not recommend that on a platform with popular support.
CURRENT has debugging turned on and its so verbose you might think it is broken.

Pi is the most supported Arm platform we have on FreeBSD in my opinion. RELEASE is best.
That allows the use of freebsd-update. A major asset on ARM64 devices.
 
  • Thanks
Reactions: swt
I am looking to place here an exact write up of the boot sequence. Klara Systems adds this UEFI write up about aarch64 https://klarasystems.com/articles/the-freebsd-boot-process/

I am trying to copy and paste from my running FreeBSD 14.0-CURRENT Raspberry Pi 4B booting from an external USB SSD drive.

The 4 color picture on the HDMI screen is the raspi BCM2711 chip Video Display Unit (VDU) telling you that the VDU can NOT FIND the boot files in a UEFI GPT disk or MBR Disk config.txt start4X.elf fixme4.elf

Code:
mount
/dev/da0p10 on / (ufs, local, soft-updates)
devfs on /dev (devfs)
/dev/da0p1 on /mnt/msdos (msdosfs, local)
There are 2 partitions related to my Raspberry Pi 4B from an external USB Flash Drive SSD. 1 st partition is /dev/da0p1 is formated FAT32 msdosfs Command
Code:
mkdir  /mnt/msdos  mount -t msdosfs /dev/da0p1 /mnt/msdos
mount see what is there. ls /mnt/msdos ; cd /mnt/msdos

The 10th partition is /dev/da0p1 and is automatically mounted by the booting of FreeBSD O/S . It is a 92 GB partition formatted in Unix File System (UFS)


root@Fred_RasPi4B:/mnt/msdos # ls -l
total 22644
drwxr-xr-x 1 root wheel 4096 Feb 9 2022 AUTO-UEF
drwxr-xr-x 1 root wheel 4096 Oct 21 2021 EFI
-rwxr-xr-x 1 root wheel 1594 Mar 3 2021 LICENCE.broadcom
drwxr-xr-x 1 root wheel 4096 Feb 7 2022 MSDOSBOOT
-rwxr-xr-x 1 root wheel 240 Oct 21 2021 README
-rwxr-xr-x 1 root wheel 5888 Oct 21 2021 armstub8-gic.bin
-rwxr-xr-x 1 root wheel 5888 Oct 21 2021 armstub8.bin
-rwxr-xr-x 1 root wheel 26894 Feb 7 2022 bcm2710-rpi-2-b.dtb
-rwxr-xr-x 1 root wheel 29011 Feb 7 2022 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root wheel 28392 Feb 7 2022 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root wheel 26890 Feb 7 2022 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root wheel 49090 Feb 7 2022 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root wheel 52456 Mar 3 2021 bootcode.bin
-rwxr-xr-x 1 root wheel 2008 Jan 24 12:05 bootfiles_raspi4b_January_24_2023.md5
-rwxr-xr-x 1 root wheel 1336 Feb 3 14:35 config.txt
-rwxr-xr-x 1 root wheel 815 Jan 18 06:01 config.txt.Jan22_2023
-rwxr-xr-x 1 root wheel 589 Feb 14 2022 config.txt.feb15
-rwxr-xr-x 1 root wheel 1325 Jan 26 06:15 config.txt.feb3_2023
-rwxr-xr-x 1 root wheel 178 Jan 17 2022 config.txt.original
drwxr-xr-x 1 root wheel 4096 Oct 21 2021 dtb
-rwxr-xr-x 1 root wheel 3532 Feb 13 2022 efibootmgr_Lenovo_T430.txt
-rwxr-xr-x 1 root wheel 7314 Feb 7 2022 fixup.dat
-rwxr-xr-x 1 root wheel 5448 Feb 7 2022 fixup4.dat
-rwxr-xr-x 1 root wheel 3187 Feb 7 2022 fixup4cd.dat
-rwxr-xr-x 1 root wheel 8452 Feb 7 2022 fixup4db.dat
-rwxr-xr-x 1 root wheel 8454 Feb 7 2022 fixup4x.dat
-rwxr-xr-x 1 root wheel 3187 Feb 7 2022 fixup_cd.dat
-rwxr-xr-x 1 root wheel 10298 Feb 7 2022 fixup_db.dat
-rwxr-xr-x 1 root wheel 10298 Feb 7 2022 fixup_x.dat
drwxr-xr-x 1 root wheel 4096 Jan 23 18:35 fred
drwxr-xr-x 1 root wheel 8192 Mar 14 2021 icons
drwxr-xr-x 1 root wheel 4096 Oct 21 2021 overlays
drwxr-xr-x 1 root wheel 4096 Mar 14 2021 refind
-rwxr-xr-x 1 root wheel 243712 Feb 13 2022 refind_aa64.efi
-rwxr-xr-x 1 root wheel 2952960 Mar 3 2021 start.elf
-rwxr-xr-x 1 root wheel 2228800 Mar 3 2021 start4.elf
-rwxr-xr-x 1 root wheel 793116 Mar 3 2021 start4cd.elf
-rwxr-xr-x 1 root wheel 3722504 Mar 3 2021 start4db.elf
-rwxr-xr-x 1 root wheel 2981192 Mar 3 2021 start4x.elf
-rwxr-xr-x 1 root wheel 793116 Mar 3 2021 start_cd.elf
-rwxr-xr-x 1 root wheel 4794472 Mar 3 2021 start_db.elf
-rwxr-xr-x 1 root wheel 3704808 Mar 3 2021 start_x.elf
-rwxr-xr-x 1 root wheel 568960 Oct 21 2021 u-boot.bin
-rwxr-xr-x 1 root wheel 1128 Jan 26 07:28 ~instal_sysutils_rpi-firmware.txt
This is a listing of the /mnt/msdos partition /dev/da0p1 beginning directory. Important files, start4.elf fixup4.dat config.txt

cat config.txt
# https://www.vinnie.work/blog/2020-11-06-baremetal-rpi4-setup
# https://docs.rtems.org/branches/master/user/bsps/bsps-aarch64.html#raspberry-pi-4b
# if user wants to enable GIC, uncomment the next line
# enable_gic=1
# arm_64bit=1
# dtoverlay = disable-bt
# enable_uart=1

# Disable pull downs
gpio=14,15,22-27=np
# set up uart3, disable pull downs, alt4 function 4:txd 5:rxd pin 7,29
gpio=4,5=np,a4

# Enable jtag pins (i.e. GPIO22-GPIO27)
enable_jtag_gpio=1
enable_uart=1
dtoverlay=uart3
dtoverlay=

device_tree_address=0x4000
kernel=u-boot.bin
#kernel=refind_aa64.efi
arm_64bit=1
# dtparam=audio=on,i2c_arm=on,spi=on
dtparam=audio=on
dtoverlay=mmc
dtoverlay=disable-bt
dtoverlay=vc4-kms-v3d
max_framebuffers=2

[pi4]
#hdmi_safe=1
##### START audio over hdmi #####
# You need them both set because hdmi_group=1 tells the kernel we are using CEA
# mode (for TV's, has sound) instead of DMT mode(for monitors, no sound) and
# hdmi_drive=2 tells the kernel to use HDMI if available. (HDMI mode has sound,
DVI does not.)
#hdmi_group=2 # DTE monitors, no HDMI sound
hdmi_group=1
hdmi_drive=2
hdmi_mode=16
# hdmi_mode=16 1080p 60Hz 16:9
# hdmi_mode=4 720p 60Hz 16:9
# hdmi_mode=15 480p 60Hz 16:9 double pixels
##### END audio over hdmi #####
armstub=armstub8-gic.bin
arm_boost=1
[all]

over_voltage=2
arm_freq=1500
gpu_freq=600
These files match what I am working on my Raspberry Pi 4B with my needs and uses. Do not copy directly. They may work for you. They may NOT work for your situation.

Check what ever is the 1st "FAT32 formatted" partition on your microSD memory card, USB Flash Disk stick, external USB Flash Disk Drive (SSD). That has the ESP and BOOT flags enabled.

EEPROM configuration number 0xF41 is the number to use for booting (or is it 0xF51 ) from USB Flash Drive Stick or external USB Flash Drive Disk (SSD).
 
Look, I know this is messy and not exactly correct for FreeBSD. I was trying to make 2 or 3 Linux useable partitions and 1 FreeBSD partition. Using
Code:
bsdinstall
also did its own method, that might use BSD slices format in a partition. This makes it more confusing to understand. I post these raw messy data as what is working for me at this early time. Does not make it true or correct FreeBSD partitioning data. I used a manually hand edited shell script file for the Linux "parted" command and an internal script ran by "parted" to create these 10 partitions. I used the -a optimal parted option, Later I found that my SSD drive used 4K byte sectors. I deleted that partition and recreated using FreeBSD gpart commands with the -a 4k to align the start of the partition on a 4K byte boundary. In other reading about partition creation, I came across a suggestion to use 1 Megabyte boundaries when using SSD disks. Please reply if you have further partition creation notes about what size boundaries to use that better match with Flash Chips internal structure and with the SSD SATA disk interface. Maybe something with NVMe flash disk drives has a still different boundary needs. Please Comment.
Code:
gpart status
Name Status Components
da0p1 OK da0
da0p2 OK da0
da0p3 OK da0
da0p4 OK da0
da0p5 OK da0
da0p6 OK da0
da0p7 OK da0
da0p8 OK da0
da0p9 OK da0
da0p10 OK da0
da0p2s1 OK da0p2
da0p2s2 OK da0p2
da0p2s3 OK da0p2
da0p4s1 OK da0p4
da0p4s2 OK da0p4
gpt/Raspup8ARM64s1 OK gpt/Raspup8ARM64
gpt/Raspup8ARM64s2 OK gpt/Raspup8ARM64
gpt/Raspup8ARM64s3 OK gpt/Raspup8ARM64
gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365s1 OK gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365
gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365s2 OK gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365
gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365s3 OK gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365
gpt/FreeBSD-Arm64s1 OK gpt/FreeBSD-Arm64
gpt/FreeBSD-Arm64s2 OK gpt/FreeBSD-Arm64
gptid/cff09c18-8bf3-11ec-8daf-0021ccd45decs1 OK gptid/cff09c18-8bf3-11ec-8daf-0021ccd45dec
gptid/cff09c18-8bf3-11ec-8daf-0021ccd45decs2 OK gptid/cff09c18-8bf3-11ec-8daf-0021ccd45dec


root@Fred_RasPi4B:/mnt/msdos #
Code:
cat /etc/fstab
# Fred File /tmp/bsdinstall_etc/fstab
/dev/da0p9 none swap sw 0 0
/dev/da0p10 / ufs rw 1 1
/dev/da0p1 /mnt/msdos msdosfs rw 1 1

root@Fred_RasPi4B:/mnt/msdos #
Code:
swapinfo -m
Device 1M-blocks Used Avail Capacity
/dev/da0p9 8192 0 8192 0%

root@Fred_RasPi4B:/mnt/msdos #
Code:
gpart show
=> 34 976773101 da0 GPT (466G)
34 6 - free - (3.0K)
40 10485720 1 efi (5.0G)
10485760 10485760 2 linux-data (5.0G)
20971520 319488000 3 linux-data (152G)
340459520 203423744 10 freebsd-ufs (97G)
543883264 1376256 - free - (672M)
545259520 65536000 5 linux-data (31G)
610795520 81920000 6 linux-data (39G)
692715520 16777216 7 linux-swap (8.0G)
709492736 25616384 8 linux-data (12G)
735109120 205520896 4 freebsd-ufs (98G)
940630016 16777216 9 freebsd-swap (8.0G)
957407232 19365903 - free - (9.2G)

=> 63 10485697 da0p2 MBR (5.0G)
63 1985 - free - (993K)
2048 1046528 1 fat32lba (511M)
1048576 2048 - free - (1.0M)
1050624 1048576 2 linux-swap (512M)
2099200 1994752 3 linux-data (974M)
4093952 6391808 - free - (3.0G)

=> 63 205520833 da0p4 MBR (98G)
63 2016 - free - (1.0M)
2079 102312 1 fat32lba [active] (50M)
104391 6187041 2 freebsd (3.0G)
6291432 199229464 - free - (95G)

=> 63 10485697 gpt/Raspup8ARM64 MBR (5.0G)
63 1985 - free - (993K)
2048 1046528 1 fat32lba (511M)
1048576 2048 - free - (1.0M)
1050624 1048576 2 linux-swap (512M)
2099200 1994752 3 linux-data (974M)
4093952 6391808 - free - (3.0G)

=> 63 10485697 gptid/3757e3a0-1ed6-4fa6-893f-6509478c9365 MBR (5.0G)
63 1985 - free - (993K)
2048 1046528 1 fat32lba (511M)
1048576 2048 - free - (1.0M)
1050624 1048576 2 linux-swap (512M)
2099200 1994752 3 linux-data (974M)
4093952 6391808 - free - (3.0G)

=> 63 205520833 gpt/FreeBSD-Arm64 MBR (98G)
63 2016 - free - (1.0M)
2079 102312 1 fat32lba [active] (50M)
104391 6187041 2 freebsd (3.0G)
6291432 199229464 - free - (95G)

=> 63 205520833 gptid/cff09c18-8bf3-11ec-8daf-0021ccd45dec MBR (98G)
63 2016 - free - (1.0M)
2079 102312 1 fat32lba [active] (50M)
104391 6187041 2 freebsd (3.0G)
6291432 199229464 - free - (95G)
 
Here is what is in the "/mnt/msdos" directory that contains start4.elf fixme4.dat config.txt Subdirectory /mnt/msdos/efi I think FreeBSD is the important directory. Have to look at efibootmgr and efivar commands for boot order details for this UEFI GPT disk partition setup.
root@Fred_RasPi4B:/mnt/msdos # ls -l efi
total 16
drwxr-xr-x 1 root wheel 4096 Oct 21 2021 BOOT
drwxr-xr-x 1 root wheel 4096 Feb 13 2022 FreeBSD
drwxr-xr-x 1 root wheel 4096 Feb 13 2022 RasPup
drwxr-xr-x 1 root wheel 4096 Feb 13 2022 rEFInd
root@Fred_RasPi4B:/mnt/msdos # ls -l efi/BOOT
total 1240
-rwxr-xr-x 1 root wheel 1266108 Oct 21 2021 bootaa64.efi
root@Fred_RasPi4B:/mnt/msdos # ls -l efi/FreeBSD
total 868
-rwxr-xr-x 1 root wheel 887808 Feb 13 2022 loader.efi
root@Fred_RasPi4B:/mnt/msdos # ls -l efi/RasPup
total 52
-rwxr-xr-x 1 root wheel 52480 Feb 13 2022 bootcode.bin
root@Fred_RasPi4B:/mnt/msdos # ls -l efi/rEFInd
total 240
-rwxr-xr-x 1 root wheel 243712 Feb 13 2022 refind_aa64.efi
root@Fred_RasPi4B:/mnt/msdos #
At some point, we should use md5deep and hashdeep to audit these boot files and create checksum md5 or sha256sum numbers. Audit your /bootfiles with md5deep and hashdeep GhostBSD-ARM64.blogspot.com entry
Getting Started with md5deep
Manual page with options for MD5DEEP

efibootmgr
efibootmgr: [-aAnB -b bootnum] [-N] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help]
[-c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum]]
root@Fred_RasPi4B:/mnt/msdos # efibootmgr -a
efibootmgr: efibootmgr [-a | -A] -b bootnum
root@Fred_RasPi4B:/mnt/msdos # efibootmgr -A
efibootmgr: efibootmgr [-a | -A] -b bootnum
root@Fred_RasPi4B:/mnt/msdos # efibootmgr
BootCurrent: 0000

root@Fred_RasPi4B:/mnt/msdos # efibootmgr --verbose
BootCurrent: 0000
root@Fred_RasPi4B:/mnt/msdos # efibootmgr --help
efibootmgr: [-aAnB -b bootnum] [-N] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help]
[-c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum]]
root@Fred_RasPi4B:/mnt/msdos # efibootmgr -N
efibootmgr: efi_del_variable: Function not implemented
root@Fred_RasPi4B:/mnt/msdos # efivar
8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot
8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-AuditMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-DeployedMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-VendorKeys
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLangCodes
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLang
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndicationsSupported
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications
cfee69ad-a0de-47a9-93a8-f63106f8ae99-LoaderPath
cfee69ad-a0de-47a9-93a8-f63106f8ae99-LoaderDev
root@Fred_RasPi4B:/mnt/msdos #
I don't understand the above efi variables and where this information is located and how to manipulate these variables. More to learn in the future
efivar man page FreeBSD+13.1-RELEASE
https://wiki.debian.org/UEFI Debian UEFI for your information needs
https://wiki.freebsd.org/UEFI FreeBSD UEFI wiki
efibootmgr FreeBSD Release 13.1 man page
efi man page FreeBSD 13.0 Release
Gawen Blog for FreeBSD , Linux aarch64 Raspberry Pi, Tayga
 
Download FreeBSD 14.0-CURRENT, Instead You start with FreeBSD 13.1
Config.txt April 1, 2021 Changes for Raspberry Pi 4B

What have you set your EEPROM Configuration value 0xF41 or 0xF5421 using Raspi-Config tool for Raspberry Pi O/S. When the 4 color screen shows up and the error message says it can not find these files, that must mean its not looking in the right place. Use a microSD card memory reader with FreeBSD.org or GhostBSD.org to check that you have a EFI System Partition (ESP) FAT32 formatted with start4.elf fixme4.dat config.txt u-boot.bin
-rwxr-xr-x 1 root wheel 49090 Feb 7 2022 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root wheel 52456 Mar 3 2021 bootcode.bin
-rwxr-xr-x 1 root wheel 1336 Feb 3 14:35 config.txt
-rwxr-xr-x 1 root wheel 5448 Feb 7 2022 fixup4.dat
-rwxr-xr-x 1 root wheel 2228800 Mar 3 2021 start4.elf
Where to select version of FreeBSD snapshot or image to download.
https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/ FreeBSD 13.1 RPI 3/4 Snapshot image
https://download.freebsd.org/releas...FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz This is the 13.1 arm64 aarch64 RPI image for Raspi 3 and Raspi 4B
https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/CHECKSUM.SHA256-FreeBSD-13.1-RELEASE-arm64-aarch64-RPI Sha256 Checksum Value This is the value to use sha256sum command on the downloaded img.xz file.

Download the Checksum 122 digit value
curl -o https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz
Download the FreeBSD 13.1-RELEASE Raspberry Pi 3/4 image file
curl -O https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz This will take 15 minutes plus to download 2.9 GB at 500Kbytes a second

Again, check the EEPROM Configuration value to select boot order. Use Rapberry Pi O/S raspi-config tool to see EEPROM Configuration value.

Raspberry Pi 4B EEPROM configuration
Insert URL link to Raspberry-Pi Software Tools. https://github.com/raspberrypi/rpi-eeprom/
Insert URL link to VDU boot before starting ARM CPU in Raspberry Pi BCM2711 Broadcom chip
Boot Options line in config.txt file https://www.raspberrypi.com/documentation/computers/config_txt.html#boot-options

Updating the Bootloader​


Raspberry Pi 4 and Raspberry Pi 400​

Raspberry Pi OS automatically updates the bootloader for critical bug fixes. The recommended methods for manually updating the bootloader or changing the boot modes are Raspberry Pi Imager and raspi-config
Documentation https://www.raspberrypi.com/documentation/computers/raspberry-pi.html

Boot Sequence for BCM2711 Raspberry Pi 4B
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-flow
https://hackaday.io/page/6372-raspberry-pi-4-boot-sequence
https://forums.raspberrypi.com/viewtopic.php?t=266130 Boot Process for Raspi4B BCM2711
https://elinux.org/The_Undocumented_Pi
https://raspberrypi.stackexchange.com/questions/14862/why-does-the-raspberry-pis-gpu-control-the-first-stages-of-the-boot-process GPU startup explanation
https://raspberrypi.stackexchange.com/questions/10442/what-is-the-boot-sequence Great Picture Flow Diagram


Best of Luck booting FreeBSD on your Raspberry Pi 4B. Please comment and suggest improvements.
 
Check for proper download of binary files FreeBSD*.img.xz

Code:
hashdeep -c sha256  *
%%%% HASHDEEP-1.0
%%%% size,sha256,filename
## Invoked from: /usr/home/fred/ARM64/RaspberryPi4B_linux_src/binaries
## $ hashdeep -c sha256 CHECKSUM.SHA256-FreeBSD-13.1-RELEASE-arm64-aarch64-RPI FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz raspi4b_hashdeep_md5_all_February_7_2023.txt raspi4b_hashdeep_md5_February_7_2023.txt
##

492776176,442a0ccd9000f50a72c34c8c084279f4126d8c1c472373c8ebf113c81990d0d1,/usr/home/fred/ARM64/RaspberryPi4B_linux_src/binaries/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz

Code:
sha256 Free*.xz
SHA256 (FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz) = 442a0ccd9000f50a72c34c8c084279f4126d8c1c472373c8ebf113c81990d0d1


Code:
cat CHECKSUM*
SHA256 (FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz) = 442a0ccd9000f50a72c34c8c084279f4126d8c1c472373c8ebf113c81990d0d1

Code:
unxz --decompress  FreeBS*.img.xz

Code:
ls -lh  FreeBSD*.img

You be certain of the name of the output file of=/dev/da1 for your system.
Code:
sudo umount /dev/da1 
dd if=FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img of=/dev/da1 bs=4M conv=sync status=progress
369098752 bytes (369 MB, 352 MiB) transferred 12.102s, 30 MB/s
92+0 records in
92+0 records out

mount | grep /da1
/dev/da1s2a on /media/da1s2a (ufs, local, noatime, soft-updates)
/dev/da1s1 on /media/da1s1 (msdosfs, local, noatime)


ls -lh /media/da1s1
total 44648
-rwxrwxr-x 1 root wheel 5.8K May 12 2022 armstub8-gic.bin*
-rwxrwxr-x 1 root wheel 5.8K May 12 2022 armstub8.bin*
-rwxrwxr-x 1 root wheel 26K Mar 3 2021 bcm2710-rpi-2-b.dtb*
-rwxrwxr-x 1 root wheel 28K Mar 3 2021 bcm2710-rpi-3-b-plus.dtb*
-rwxrwxr-x 1 root wheel 28K Mar 3 2021 bcm2710-rpi-3-b.dtb*
-rwxrwxr-x 1 root wheel 48K Mar 3 2021 bcm2711-rpi-4-b.dtb*
-rwxrwxr-x 1 root wheel 51K Mar 3 2021 bootcode.bin*
-rwxrwxr-x 1 root wheel 177B May 12 2022 config.txt*
drwxrwxr-x 1 root wheel 4.0K May 12 2022 dtb/
drwxrwxr-x 1 root wheel 4.0K May 12 2022 EFI/
-rwxrwxr-x 1 root wheel 3.1K Mar 3 2021 fixup_cd.dat*
-rwxrwxr-x 1 root wheel 10K Mar 3 2021 fixup_db.dat*
-rwxrwxr-x 1 root wheel 10K Mar 3 2021 fixup_x.dat*
-rwxrwxr-x 1 root wheel 7.1K Mar 3 2021 fixup.dat*
-rwxrwxr-x 1 root wheel 5.3K Mar 3 2021 fixup4.dat*
-rwxrwxr-x 1 root wheel 3.1K Mar 3 2021 fixup4cd.dat*
-rwxrwxr-x 1 root wheel 8.3K Mar 3 2021 fixup4db.dat*
-rwxrwxr-x 1 root wheel 8.3K Mar 3 2021 fixup4x.dat*
-rwxrwxr-x 1 root wheel 1.6K Mar 3 2021 LICENCE.broadcom*
drwxrwxr-x 1 root wheel 4.0K May 12 2022 overlays/
-rwxrwxr-x 1 root wheel 240B May 12 2022 README*
-rwxrwxr-x 1 root wheel 775K Mar 3 2021 start_cd.elf*
-rwxrwxr-x 1 root wheel 4.6M Mar 3 2021 start_db.elf*
-rwxrwxr-x 1 root wheel 3.5M Mar 3 2021 start_x.elf*
-rwxrwxr-x 1 root wheel 2.8M Mar 3 2021 start.elf*
-rwxrwxr-x 1 root wheel 2.1M Mar 3 2021 start4.elf*
-rwxrwxr-x 1 root wheel 775K Mar 3 2021 start4cd.elf*
-rwxrwxr-x 1 root wheel 3.5M Mar 3 2021 start4db.elf*
-rwxrwxr-x 1 root wheel 2.8M Mar 3 2021 start4x.elf*
-rwxrwxr-x 1 root wheel 556K May 12 2022 u-boot.bin*
fred@fredTC93-pc ~/A/R/binaries>

Code:
 ls EFI
BOOT/

Code:
ls -lh EFI/BOOT
total 2472
-rwxrwxr-x 1 root wheel 1.2M May 12 2022 bootaa64.efi*

Code:
 cat config.txt
# https://www.vinnie.work/blog/2020-11-06-baremetal-rpi4-setup
# https://docs.rtems.org/branches/master/user/bsps/bsps-aarch64.html#raspberry-pi-4b
# if user wants to enable GIC, uncomment the next line
# enable_gic=1

# Disable pull downs
# gpio=14,15,22-27=np
# Disable Pull Downs on UART0 pins gpio 14 8 TXD, gpio 15 10 RXD
gpio=14,15=np
# set up uart3, disable pull downs, alt4 function 4:txd 5:rxd pin 7,29
# gpio=4,5=np,a4

# Enable jtag pins (i.e. GPIO22-GPIO27)
# enable_jtag_gpio=1

# Enable console UART at 115200 baud default
enable_uart=1


[all]
arm_64bit=1
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=mmc
dtoverlay=disable-bt
device_tree_address=0x4000
kernel=u-boot.bin

#kernel=refind_aa64.efi
arm_64bit=1
# dtparam=audio=on,i2c_arm=on,spi=on
dtparam=audio=on
dtoverlay=mmc
dtoverlay=disable-bt
dtoverlay=vc4-kms-v3d
max_framebuffers=2

[pi4]
# hdmi_safe=1
armstub=armstub8-gic.bin
##### START audio over hdmi #####
# You need them both set because hdmi_group=1 tells the kernel we are using CEA
# mode (for TV's, has sound) instead of DMT mode(for monitors, no sound) and
# hdmi_drive=2 tells the kernel to use HDMI if available. (HDMI mode has sound,
DVI does not.)
#hdmi_group=2 # DTE monitors, no HDMI sound
hdmi_group=1
hdmi_drive=2
hdmi_mode=16
# hdmi_mode=16 1080p 60Hz 16:9
# hdmi_mode=4 720p 60Hz 16:9
# hdmi_mode=15 480p 60Hz 16:9 double pixels
##### END audio over hdmi #####

# arm_boost=1
[all]

# over_voltage=2
# arm_freq=1500
# gpu_freq=600
 
Back
Top