forked from rust-bitcoin/rust-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`.
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
apt install gcc-arm-none-eabi qemu-system-arm gdb-multiarch |