diff --git a/README.md b/README.md index 8e17097..cbbceaa 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,48 @@ -Cross-compiling Rust for the Raspberry PI +Cross-compiling Rust for the Q7S ====== +# Build with `cargo` + +Build debug image: + +```sh +cargo build --target armv7-unknown-linux-gnueabihf +``` + +You can then transfer the application with `scp`. It is recommended to use +the `q7s-cp.py` utility which is part of the +[EIVE OBSW script folder](https://egit.irs.uni-stuttgart.de/eive/eive-obsw). + +If you use this script, you can use the `deploy-q7s.sh` script to deploy the +binary conveniently. + # Prerequisites -1. Install standard library +1. Install rust on your development machine using `rustup` + + ```sh + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + ``` + +2. Install standard library for target architecture ```sh rustup target add armv7-unknown-linux-gnueabihf ``` -2. Install a cross-compile toolchain and add it to your path. - You can download one built with crosstool-ng from - [here](https://www.dropbox.com/sh/hkn4lw87zr002fh/AAAO-HxFQzfmmPQQ9KVmoooGa?dl=0). +3. Install a cross-compile toolchain for the Cortex-A9 target and add it to your path. + It is recommended to take the same toolchain used to compile the Q7S primary OBSW. + See the [dedicated README](https://egit.irs.uni-stuttgart.de/eive/eive-obsw) + for more details and download links. + +4. Install `sshpass` + + ```sh + sudo apt-get install sshpass + ``` + +5. Specify the ssh password as the `SSHPASS` variable + + ```sh + export SSHPASS="" + ``` diff --git a/deploy-q7s.sh b/deploy-q7s.sh index fb907ad..2166736 100755 --- a/deploy-q7s.sh +++ b/deploy-q7s.sh @@ -1,5 +1,4 @@ -#!/bin/bash -i -echo $PATH +#!/bin/bash target="armv7-unknown-linux-gnueabihf" cargo build --target ${target}