BL808 Custom Lowload

From OpenBouffalo
Revision as of 08:25, 14 May 2023 by Gamiee (talk | contribs) (Restore backup, author: Hunter1753)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To currently be able to use the peripherals not connected to the core running linux (d0) we have to catch the interrupts on the m0 core. This guide aims to show you how to set up the environment to create custom lowloaders. This setup is straight forward

Requirements

In order to set up an environment to compile for the BL808 RISC-V chip, you will need to ensure that the following tools and packages are installed on your system:

Source Tools

  • git

Build Tools

  • which
  • sed
  • make (version 3.81 or later)
  • binutils
  • build-essential (only for Debian based systems)
  • diffutils
  • gcc (version 4.8 or later)
  • g++ (version 4.8 or later, mostly installed with gcc)
  • bash
  • patch
  • gzip
  • bzip2
  • perl (version 5.8.7 or later)
  • tar
  • cpio
  • unzip
  • rsync
  • file (must be in /usr/bin/file)
  • bc
  • findutils
  • wget
  • python3

Config Tools

  • ncurses5 (could also be just called ncurses, ncurses-dev, etc.)

Make sure to have all the above tools and packages installed before proceeding with the lowload setup process.

Arch

$ pacman -Syu git which sed make binutils diffutils gcc bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget ncurses python3

Debian

$ sudo apt update
$ sudo apt install git sed make binutils diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget libncurses-dev python3

Get Tools and Source

$ cd ~/buildroot_bouffalo/
$ git clone https://github.com/openbouffalo/OBLFR.git
$ git clone https://github.com/bouffalolab/bl_mcu_sdk.git
$ git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_linux.git

Setup Toolchain Path

$ PATH=$PATH:$(pwd)/toolchain_gcc_t-head_linux/bin/

Build

$ cd OBLFR/apps/m0_lowload
$ make

Flashing

The resulting file OBLFR/apps/m0_lowload/build/build_out/m0_lowload_bl808_m0.bin or OBLFR/apps/d0_lowload/build/build_out/d0_lowload_bl808_d0.bin can be flashed like described in Ox64 Flashing