Skip to content

Letronix624/wiringx-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wiringX-rs

wiringX bindings for Rust with extra Milk-V platforms included.

Using this library requires to have gcc, make, glibc, clang and the right toolchain for the target platform installed. Please open an issue containing package manager specific install commands for this library to work out of the box.

The right RISC-V GCC toolchain can be built here.

Milk-V

To build and run your wiringX application on a Milk-V Duo Linux environment follow those steps:

  1. Boot the Duo and connect to it using ssh using ssh [email protected] with password milkv. You can also run the ssh-copy-id [email protected] command to export your ssh key to the Duo.

  2. On your Duo run ln -s /lib/ld-musl-riscv64v0p7_xthead.so.1 /lib/ld-musl-riscv64.so.1 for the programs to work.

  3. Install the riscv-gnu-toolchain, run the configure script with all default settings and no flags, then run sudo make musl

  4. Open your ~/.cargo/config.toml and add this to make it compile:

[target.riscv64gc-unknown-linux-musl]
linker = "riscv64-unknown-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
  1. Compile your Rust program to the riscv64gc-unknown-linux-musl architecture using wiringX in Rust using the nightly toolchain and build-std flags to unlock the standard library using this specific command: cargo +nightly build --release --target=riscv64gc-unknown-linux-musl -Zbuild-std=std,core

  2. If the program has successfully compiled, scp it to your Duo using scp -O target/riscv64gc-unknown-linux-musl/release/"binary_name" [email protected]:

Do not forget to replace the "binary_name" with the actual name of your binary.

  1. Run your binary.

About

Rust port of WiringX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published