Several references exist that document how to run seL4 on the Raspberry Pi 3 in 32-bit mode. One annoying paper cut encountered when getting this working is the need for a custom u-boot - either a binary distributed by the authors of seL4, or reverting a particular commit in u-boot.

A recent release of seL4 mentioned AArch64 support for RPi3. I’ve got it running, and it appears to avoid the need for a custom u-boot. (N.B. you still need a GPIO serial cable!)

I started with a stock Raspbian Lite image to get a known-good filesystem (with start.elf and bootcode.bin), then added u-boot and seL4 on top.

After installing the appropriate toolchain, seL4test can be configured and built almost as normal:

mkdir sel4test && cd sel4test
repo init -u
repo sync
mkdir build-rpi3 && cd build-rpi3
# Note AARCH64 here
./ -DPLATFORM=rpi3 -DAARCH64=1

Copy build-rpi3/images/sel4test-driver-image-arm-bcm2837 to the SD card.

U-Boot was compiled approximately as per - I chose to use the latest stable release tag, v2020.04.

make CROSS_COMPILE=aarch64-linux-gnu- rpi_3_defconfig
make -j -s CROSS_COMPILE=aarch64-linux-gnu-

Copy u-boot.bin to the SD card.

Edit config.txt to add:

# Enable 64 bit mode

Additionally I add a boot.scr file that automates loading and booting the image. First create boot.txt with the commands from the seL4 RPi3 support page:

fatload mmc 0 0x10000000 sel4test-driver-image-arm-bcm2837
bootelf 0x10000000

Then use mkimage from the u-boot source tree:

mkimage -A arm -O linux -T script -C none -n boot.scr -d boot.txt boot.scr

Copy boot.scr to the SD card.

If all is well, your serial output should show the test suite running to a reassuring conclusion:

U-Boot 2020.04 (May 11 2020 - 22:37:52 +0100)                                   
DRAM:  948 MiB                                                                  
RPI 3 Model B (0xa02082)                                                        
MMC:   mmc@7e202000: 0, sdhci@7e300000: 1                                       
Loading Environment from FAT... *** Warning - bad CRC, using default environment
In:    serial                                                                   
Out:   vidconsole                                                               
Err:   vidconsole                                                               
Net:   No ethernet found.                                                       
starting USB...                                                                 
Bus usb@7e980000: scanning bus usb@7e980000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found            
Hit any key to stop autoboot:  0                                                
switch to partitions #0, OK                                                     
mmc0 is current device                                                          
Scanning mmc 0:1...                                                             
Found U-Boot script /boot.scr                                                   
151 bytes read in 5 ms (29.3 KiB/s)                                             
## Executing script at 02400000                                                 
3199560 bytes read in 141 ms (21.6 MiB/s)                                       
## Starting application at 0x00901000 ...                                       
ELF-loader started on CPU: ARM Ltd. Cortex-A53 r0p4                             
No DTB passed in from boot loader.                                              
Looking for DTB in CPIO archive...found at a235c0.                              
Loaded DTB from a235c0.                                                         
ELF-loading image 'kernel'                                                      
ELF-loading image 'sel4test-driver'                                             
Enabling MMU and paging                                                         
Jumping to kernel-image entry point... 
[...snip test output...]
Test suite passed. 128 tests passed. 41 tests disabled.                         
All is well in the universe