Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Instruction] How to build on Debian Buster and Bullseye #3

Open
elfmimi opened this issue Jul 28, 2021 · 1 comment
Open

[Instruction] How to build on Debian Buster and Bullseye #3

elfmimi opened this issue Jul 28, 2021 · 1 comment

Comments

@elfmimi
Copy link

elfmimi commented Jul 28, 2021

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
Copy link
Author

elfmimi commented Sep 9, 2021

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 elfmimi changed the title [Instruction] How to build on Debian Buster [Instruction] How to build on Debian Buster and Bullseye Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant