Building

Open the terminal and clone the upstream Buildroot repository and the Buildroot Bouffalo overlay repository.

mkdir -p ~/ox64
cd ~/ox64
git clone https://github.com/buildroot/buildroot
git clone https://github.com/openbouffalo/buildroot_bouffalo

Define an environment variable for the Buildroot Bouffalo overlay path.

export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo

Change directory into the cloned Buildroot folder.

cd ~/ox64/buildroot

Apply the default configuration for Pine64 Ox64.

make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH pine64_ox64_defconfig

Use the menuconfig tool to adjust the build settings.

make menuconfig

Within menuconfig, configure the following.

  • Navigate to Target Options

  • Enable Integer Multiplication and Division (M)

  • Enable Atomic Instructions (A)

  • Enable Single-precision Floating-point (F)

  • Enable Double-precision Floating-point (D)

  • Set Target ABI to lp64d

  • Under Toolchain, enable Fortran support and OpenMP support

Initiate the build process, but first make sure that your PATH variable contains no spaces.

make

Buildroot will output to the ~/ox64/buildroot/output/images directory.

Optional: create a combined SoC image

Use the following commands to combine m0_lowload_bl808_m0.bin, d0_lowload_bl808_d0.bin, and bl808-firmware.bin into a single image. This is mainly useful for troubleshooting (e. g. when using DevCube v1.8.4 or later for flashing process).

cd ~/ox64/buildroot/output/images

fallocate -l 0x800000 bl808-combined.bin
dd conv=notrunc if=m0_lowload_bl808_m0.bin of=bl808-combined.bin
dd conv=notrunc if=d0_lowload_bl808_d0.bin of=bl808-combined.bin seek=$((0x100000))B
cat bl808-firmware.bin >> bl808-combined.bin

Check that you have the required files for flashing

cd ~/ox64/buildroot/output/images
ls *808*.bin *.img

Expected files:

  • sdcard.img

  • m0_lowload_bl808_m0.bin

  • d0_lowload_bl808_d0.bin

  • bl808-firmware.bin

  • bl808-combined.bin (if you created the combined image)