RV-Debugger-BL702 icon indicating copy to clipboard operation
RV-Debugger-BL702 copied to clipboard

[Instruction] How to build on Debian Buster and Bullseye

Open elfmimi opened this issue 4 years ago • 1 comments

How to build on Debian Buster

To build RV-Debugger-BL702 you need a compiler. which is available in the following 3 packages.

binutils-riscv64-unknown-elf
gcc-riscv64-unknown-elf
picolibc-riscv64-unknown-elf

Current stable, Buster, does not have these packages. So we'll have to borrow them from current testing, Bullseye.

Specifically you'll need the following 3 package files. ( at the time of writing )

pool/main/b/binutils-riscv64-unknown-elf/binutils-riscv64-unknown-elf_2.32.2020.04+dfsg-2_amd64.deb
pool/main/g/gcc-riscv64-unknown-elf/gcc-riscv64-unknown-elf_8.3.0.2019.08+dfsg-1_amd64.deb
pool/main/p/picolibc/picolibc-riscv64-unknown-elf_1.5.1-2_all.deb

Which can be found at the following locations respectively.

https://ftp.debian.org/debian/pool/main/b/binutils-riscv64-unknown-elf/
https://ftp.debian.org/debian/pool/main/g/gcc-riscv64-unknown-elf/
https://ftp.debian.org/debian/pool/main/p/picolibc/

Install those 3 packages using dpkg command.

> dpkg -i binutils-riscv64-unknown-elf_2.32.2020.04+dfsg-2_amd64.deb
> dpkg -i gcc-riscv64-unknown-elf_8.3.0.2019.08+dfsg-1_amd64.deb
> dpkg -i picolibc-riscv64-unknown-elf_1.5.1-2_all.deb

note: you need root privilege

clone this repo and do a small patching.

> git clone https://github.com/sipeed/RV-Debugger-BL702
> cd RV-Debugger-BL702
> echo "add_compile_options(-specs=picolibc.specs)" >> tools/cmake/compiler_flags.cmake
> echo "add_link_options(-specs=picolibc.specs)" >> tools/cmake/compiler_flags.cmake

then edit CMakeList.txt .

@@ -1,1 +1,1 @@
- cmake_minimum_required(VERSION 3.15)
+ cmake_minimum_required(VERSION 3.13)

finally fire up the make command.

> make

and binary firmware file will be created at out/usb/usb2uartjtag/main.bin .

of course you need make and cmake. so do install them if you haven't yet.

> apt install make cmake

note: you need root privilege

elfmimi avatar Jul 28 '21 12:07 elfmimi

How to build on Debian Bullseye

apt install git make cmake binutils-riscv64-unknown-elf gcc-riscv64-unknown-elf picolibc-riscv64-unknown-elf

note: you'll need root privilege for the above command.

then

> git clone https://github.com/sipeed/RV-Debugger-BL702
> cd RV-Debugger-BL702
> echo "add_compile_options(-specs=picolibc.specs)" >> tools/cmake/compiler_flags.cmake
> echo "add_link_options(-specs=picolibc.specs)" >> tools/cmake/compiler_flags.cmake
> make

binary firmware file will be created at out/usb/usb2uartjtag/main.bin .

elfmimi avatar Sep 09 '21 13:09 elfmimi