Skip to content

Commit

Permalink
Merge pull request #40 from erdnaxe/rust-objcopy
Browse files Browse the repository at this point in the history
README: use rust-objcopy
  • Loading branch information
romancardenas authored Nov 24, 2024
2 parents ded9e57 + fb98d8b commit c2daee8
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,7 @@ One of:
- [RV-LINK](https://gitee.com/zoomdy/RV-LINK)
- [stm32flash](https://sourceforge.net/projects/stm32flash/)

When using `dfu-util`, the entire RISC-V toolchain is not necessary. Only `objcopy` from [riscv-binutils-gdb](https://github.com/sifive/riscv-binutils-gdb.git) is needed.

It can be compiled with the following commands:

```
git clone https://github.com/sifive/riscv-binutils-gdb.git
cd riscv-binutils-gdb
./configure --target=riscv64-unknown-elf --disable-werror --with-python=no --disable-gdb --disable-sim --disable-libdecnumber --disable-libreadline --with-expat=yes --with-mpc=no --with-mpfr=no --with-gmp=no
make
```

It will provide the `binutils/objcopy` tool needed to convert the compiled Rust binary into `firmware.bin` (note: this works on arm64 as well).
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.

### Building

Expand Down Expand Up @@ -71,7 +60,7 @@ Steps to flash an example via DFU:
1) Extract the binary

```sh
riscv-nuclei-elf-objcopy -O binary target/riscv32imac-unknown-none-elf/release/blinky firmware.bin
rust-objcopy -O binary target/riscv32imac-unknown-none-elf/release/examples/blinky firmware.bin
```

2) Flash using `dfu-util`:
Expand Down

0 comments on commit c2daee8

Please sign in to comment.