rust-bitcoin-unsafe-fast/bitcoin/embedded
Tobin C. Harding 3af9258025
embedded: Document how to clean up linker flags
Our embedded crate includes instructions to source a shell script that
sets the `RUSTFLAGS` env var. Having the env var set like this in ones
environment breaks linkage when trying to do "regular" builds.

Document how to clean up.
2023-05-26 14:39:14 +10:00
..
scripts Import bitcoin_hashes crate into hashes 2022-11-08 08:58:09 +11:00
src embedded: Remove error handler 2023-04-26 14:29:39 +10:00
Cargo.toml Patch hashes and update the code 2022-12-18 14:33:55 +01:00
README.md embedded: Document how to clean up linker flags 2023-05-26 14:39:14 +10:00
memory.x Import bitcoin_hashes crate into hashes 2022-11-08 08:58:09 +11:00

README.md

Running

To run the embedded test, first prepare your environment:

sudo ./scripts/install-deps
rustup +nightly target add thumbv7m-none-eabi

Then:

source ./scripts/env.sh && cargo +nightly run --target thumbv7m-none-eabi

Output should be something like:

heap size 524288
secp buf size 66240
Seed WIF: L1HKVVLHXiUhecWnwFYF6L3shkf1E12HUmuZTESvBXUdx3yqVP1D
Address: bc1qpx9t9pzzl4qsydmhyt6ctrxxjd4ep549np9993

Note that this heap size is required because of the amount of stack used by libsecp256k1 when initializing a context.

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.

unset RUSTFLAGS