From 206c648869fa89aff1550647f47c436a81d504f9 Mon Sep 17 00:00:00 2001 From: Devrandom Date: Mon, 2 Aug 2021 09:55:11 +0200 Subject: [PATCH 1/2] Clean up embedded test memory configuration --- .github/workflows/rust.yml | 2 +- embedded/scripts/env.sh | 2 +- embedded/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ea74fb99..2b206cf2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -94,6 +94,6 @@ jobs: - name: Run env: RUSTFLAGS: "-C link-arg=-Tlink.x" - CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -m 1G -nographic -semihosting-config enable=on,target=native -kernel" + CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel" run: cd embedded && cargo run --target thumbv7m-none-eabi diff --git a/embedded/scripts/env.sh b/embedded/scripts/env.sh index d72a0932..125162b6 100644 --- a/embedded/scripts/env.sh +++ b/embedded/scripts/env.sh @@ -1,2 +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 -m 1G -nographic -semihosting-config enable=on,target=native -kernel" +export CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER="qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel" diff --git a/embedded/src/main.rs b/embedded/src/main.rs index c7cc5bdc..b3a89d35 100644 --- a/embedded/src/main.rs +++ b/embedded/src/main.rs @@ -25,7 +25,7 @@ use cortex_m_semihosting::{debug, hprintln}; #[global_allocator] static ALLOCATOR: CortexMHeap = CortexMHeap::empty(); -const HEAP_SIZE: usize = 1024 * 512; // 512 KB +const HEAP_SIZE: usize = 1024 * 256; // 256 KB #[entry] fn main() -> ! { From 849ec3f2c8dd8f1e2e5a321a571ce94a7a582b81 Mon Sep 17 00:00:00 2001 From: Devrandom Date: Mon, 2 Aug 2021 09:55:37 +0200 Subject: [PATCH 2/2] Enable secp256k1/alloc for no-std --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d8c0f6ec..d1b88c8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ secp-recovery = ["secp256k1/recovery"] # Instead no-std enables additional features required for this crate to be usable without std. # As a result, both can be enabled without conflict. std = ["secp256k1/std", "bitcoin_hashes/std", "bech32/std"] -no-std = ["hashbrown", "core2/alloc", "bitcoin_hashes/alloc"] +no-std = ["hashbrown", "core2/alloc", "bitcoin_hashes/alloc", "secp256k1/alloc"] [dependencies] bech32 = { version = "0.8.1", default-features = false }