From e8f4c4bfaa6cbbcb28655548d0e2f9cec0f6c488 Mon Sep 17 00:00:00 2001 From: dcz Date: Wed, 24 Sep 2025 13:35:41 +0200 Subject: [PATCH 1/2] readme: Add Fedora packages --- README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8ed3278..e74c103 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,24 @@ rustup target add riscv32imac-unknown-none-elf ``` +Either: + - RISC-V toolchain ([e.g. from SiFive](https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2019.01.0-x86_64-linux-ubuntu14.tar.gz)) -One of: +or install prebuilt toolchain (easier): + +For Ubuntu/Debian: +``` +sudo apt-get install gcc-riscv64-unknown-elf +``` + +For Fedora: + +``` +sudo dnf install binutils-riscv64-linux-gnu +``` + +For flashing, one of: - [dfu-util](http://dfu-util.sourceforge.net/) - [openocd for GD32VF103](https://github.com/riscv-mcu/riscv-openocd) @@ -31,13 +46,6 @@ One of: When using `dfu-util`, the RISC-V toolchain is not necessary. Only `rust-objcopy` from [cargo-binutils](https://github.com/rust-embedded/cargo-binutils) is needed. -Option B - Install prebuilt toolchain (easier): - -For Ubuntu/Debian: -``` -sudo apt-get install gcc-riscv64-unknown-elf -``` - ### Building If you have a GD32VF103C**B** chip on your board, edit `.cargo/config.toml` and replace From 603d8cd96501c71a4bff0896d6d68493aa4c046b Mon Sep 17 00:00:00 2001 From: dcz Date: Wed, 24 Sep 2025 13:38:43 +0200 Subject: [PATCH 2/2] Readme: Build instructions without rustup --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index e74c103..fb9b2e7 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,31 @@ To build all the provided examples run cargo build --examples --release --all-features ``` +#### Building everything including core + +An option for using only distribution packaging, no rustup, is to let the compiler pretend it's unstable and build the `core` crate. + +Install rust and its sources, and the lld linker. + +Fedora: + +``` +sudo dnf install rust rust-src lld +``` + +In `.cargo/config` add: + +``` +[target.riscv32imac-unknown-none-elf] +linker = 'lld' +``` + +Use the following command to build: + +``` +RUSTC_BOOTSTRAP=1 cargo build -Z build-std --examples --release --all-features +``` + ### Using dfu-util for Flashing The GD32VF103 contains a [DFU](https://www.usb.org/sites/default/files/DFU_1.1.pdf)