Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
24 changes: 24 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[build]
# Use our own copy of libsecp256k1-zpk instead of the one bundled with secp256k1-sys, also in `cargo
# test` and other cargo-based builds. This is replicated in src/CMakeLists.txt,
# test/simulator-graphical*/CMakeLists.txt for CMake-based builds.
# See https://github.com/rust-bitcoin/rust-secp256k1/tree/7c8270a8506e31731e540fab7ee1abde1f48314e/secp256k1-sys#linking-to-external-symbols
rustflags = ["--cfg", "rust_secp_no_symbol_renaming"]

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
rustflags = [
"--cfg", "rust_secp_no_symbol_renaming",
"-C", "linker-plugin-lto",
# This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x
# See https://github.com/rust-embedded/cortex-m-quickstart/pull/95
"-C", "link-arg=--nmagic",
]

[env]
# The Rust profiles enable LTO, and `cc` forwards that to C objects. Use LLVM
# tools for ARM C objects so linker-plugin LTO stays in the same toolchain.
# `cc` replaces target hyphens, but not dots.
"CC_thumbv8m.main_none_eabihf" = "clang-21"
"AR_thumbv8m.main_none_eabihf" = "llvm-ar-21"
"RANLIB_thumbv8m.main_none_eabihf" = "llvm-ranlib-21"
"CFLAGS_thumbv8m.main-none-eabihf" = { value = "-mcpu=cortex-m33 -flto" }
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/py/bitbox02/bitbox02/generated/* linguist-generated=true
/src/rust/bitbox-proto/src/generated/* linguist-generated=true
/external/vendor/** linguist-generated=true
/external/ST/Drivers/** linguist-generated=true
15 changes: 14 additions & 1 deletion .github/workflows/ci-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ jobs:
- firmware-btc
- factory-setup
- firmware-debug
- bitbox03-boot0
- bitbox03-boot1
- bitbox03-factorysetup
- bitbox03-firmware
- simulator
- simulator-graphical
- simulator-graphical-bb03
Expand Down Expand Up @@ -246,7 +250,15 @@ jobs:
run: ./.ci/check-unwanted-symbols

- name: Print hashes
run: sha256sum build*/bin/*
run: |
{
for dir in build*/bin src/rust/target/thumbv8m.main-none-eabihf/debug; do
if [ -d "$dir" ]; then
find "$dir" -maxdepth 1 -type f -print0
fi
done
true
} | xargs -0 -r sha256sum

- name: Upload artifact
if: github.event_name == 'push' && !cancelled()
Expand All @@ -258,6 +270,7 @@ jobs:
build*/bin/*.elf
build*/bin/*.map
build*/bin/simulator*
src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-*

# Build simulators for macos aarch64
build-macos:
Expand Down
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,47 @@ clean:
# When you vendor rust libs avoid duplicates
vendor-rust-deps:
./external/vendor-rust.sh

# It is important that cargo is executed from `src/rust` so that it loads the
# configuration for the vendored dependencies.
bitbox03-boot0:
(cd src/rust; cargo bitbox03-boot0-stm32u5-dk)
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-boot0
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-boot0
bitbox03-boot0-release:
(cd src/rust; cargo bitbox03-boot0-stm32u5-dk-release)
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-boot0
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-boot0
bitbox03-boot1:
(cd src/rust; cargo bitbox03-boot1-stm32u5-dk)
python3 scripts/bitbox03_image_header.py finalize-elf src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-boot1
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-boot1
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-boot1
bitbox03-boot1-release:
(cd src/rust; cargo bitbox03-boot1-stm32u5-dk-release)
python3 scripts/bitbox03_image_header.py finalize-elf src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-boot1
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-boot1
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-boot1
bitbox03-factorysetup:
(cd src/rust; cargo bitbox03-factorysetup-stm32u5-dk)
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-factorysetup
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-factorysetup
bitbox03-factorysetup-release:
(cd src/rust; cargo bitbox03-factorysetup-stm32u5-dk-release)
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-factorysetup
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-factorysetup
bitbox03-firmware:
(cd src/rust; cargo bitbox03-firmware-stm32u5-dk)
python3 scripts/bitbox03_image_header.py finalize-elf src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-firmware
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-firmware
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/debug/bitbox03-firmware
bitbox03-firmware-release:
(cd src/rust; cargo bitbox03-firmware-stm32u5-dk-release)
python3 scripts/bitbox03_image_header.py finalize-elf src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-firmware
arm-none-eabi-size src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-firmware
arm-none-eabi-size -Ax src/rust/target/thumbv8m.main-none-eabihf/release/bitbox03-firmware

flash-bitbox03-boot0-openocd:
./scripts/flash-bitbox03-boot0-openocd.sh
flash-bitbox03-boot1-openocd:
./scripts/flash-bitbox03-boot1-openocd.sh
Loading
Loading