hashes/embedded: Add script dir and README
To help folk work out how to run the `hashes/embedded` test crate copy over the `script` directory and an updated version of the `README` from `embedded/bitcoin`.
This commit is contained in:
parent
94732aecbf
commit
5b1443a91c
|
@ -0,0 +1,30 @@
|
|||
# Running
|
||||
|
||||
To run the embedded test, first prepare your environment:
|
||||
|
||||
```shell
|
||||
sudo ./scripts/install-deps
|
||||
rustup +nightly target add thumbv7m-none-eabi
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```shell
|
||||
source ./scripts/env.sh && cargo +nightly run --target thumbv7m-none-eabi
|
||||
```
|
||||
|
||||
Output should be something like:
|
||||
|
||||
```text
|
||||
hash:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad hash_check:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
|
||||
hash:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad hash_check:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
After sourcing `scripts/env.sh` and _before_ building again using another target
|
||||
you'll want to unset `RUSTFLAGS` otherwise you'll get linker errors.
|
||||
|
||||
```shell
|
||||
unset RUSTFLAGS
|
||||
```
|
|
@ -0,0 +1,2 @@
|
|||
export RUSTFLAGS="-C link-arg=-Tlink.x"
|
||||
export CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER="qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
apt install gcc-arm-none-eabi qemu-system-arm gdb-multiarch
|
Loading…
Reference in New Issue