From b926362be5e48451d3eadfe453f9a75c53d556a9 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Thu, 1 Jan 2026 16:15:35 +0000 Subject: [PATCH 1/6] Use just to describe all the builds and tests we want to do Also bumps the arm-targets MSRV to 1.83 to make the CI pipeline simpler --- .github/workflows/build.yml | 132 ++++++++++---------- .gitignore | 4 + arm-targets/Cargo.toml | 2 +- arm-targets/README.md | 2 +- examples/mps3-an536/src/bin/smp_test.rs | 5 +- justfile | 153 ++++++++++++++++++++++++ tests.sh | 46 +++---- 7 files changed, 241 insertions(+), 103 deletions(-) create mode 100644 justfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73a8786..ba71484 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,16 +33,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} rustup target add ${{ matrix.target }} - name: Build run: | - cargo build --target ${{ matrix.target }} - cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-multi-core, check-asm" - cargo build --target ${{ matrix.target }} --features "serde, defmt, critical-section-single-core, check-asm" + just build-tier2 ${{ matrix.target }} # These targets need build-std, and have no atomics build-tier3-no-atomics: @@ -58,39 +58,41 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install nightly-2025-10-29 rustup component add rust-src --toolchain nightly-2025-10-29 + rustup default nightly-2025-10-29 - name: Build run: | - cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core - cargo +nightly-2025-10-29 build --target ${{ matrix.target }} -Zbuild-std=core --features "serde, defmt, check-asm" + just build-tier3-no-atomics ${{ matrix.target }} - # Build the host tools - build-host: + # Build the host-only stuff + build-arm-targets: runs-on: ubuntu-24.04 needs: setup strategy: matrix: - rust: [stable, 1.59] + rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} - name: Build run: | - cd arm-targets - cargo build - cargo test + just build-arm-targets # Gather all the above build jobs together for the purposes of getting an overall pass-fail build-all: runs-on: ubuntu-24.04 - needs: [build-tier2, build-tier3-no-atomics, build-host] + needs: [build-tier2, build-tier3-no-atomics, build-arm-targets] steps: - run: /bin/true @@ -110,7 +112,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} @@ -130,7 +132,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Rust run: | rustup install ${{ matrix.rust }} rustup default ${{ matrix.rust }} @@ -147,95 +149,86 @@ jobs: - run: /bin/true # Format the workspace - fmt: + fmt-all: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install stable rustup default stable rustup component add rustfmt - name: Format run: | - cargo fmt --check + just fmt-check - # Format the host tools - fmt-host: + # Run clippy on the workpace + clippy: runs-on: ubuntu-24.04 + needs: setup + strategy: + matrix: + target: ${{ fromJSON(needs.setup.outputs.stable-targets) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install stable - rustup default stable - rustup component add rustfmt - - name: Format + rustup toolchain install 1.92 + rustup default 1.92 + rustup target add ${{ matrix.target }} + rustup component add clippy + - name: Clippy run: | - cd arm-targets - cargo fmt --check + just clippy-target ${{ matrix.target }} - # Gather all the above fmt jobs together for the purposes of getting an overall pass-fail - fmt-all: - runs-on: ubuntu-24.04 - needs: [fmt, fmt-host] - steps: - - run: /bin/true - - # Run clippy on the workpace - clippy: + # Run clippy on the examples + clippy-examples: runs-on: ubuntu-24.04 needs: setup - strategy: - matrix: - rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} - target: ${{ fromJSON(needs.setup.outputs.stable-targets) }} - exclude: - - rust: 1.83 - target: armv7a-none-eabihf - - rust: 1.83 - target: armv8r-none-eabihf steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install ${{ matrix.rust }} - rustup default ${{ matrix.rust }} - rustup target add ${{ matrix.target }} + rustup toolchain install 1.92 + rustup default 1.92 + rustup target add armv7r-none-eabihf + rustup target add armv8r-none-eabihf rustup component add clippy - name: Clippy run: | - cargo clippy --target ${{ matrix.target }} - cargo clippy --target ${{ matrix.target }} --no-default-features - cargo clippy --target ${{ matrix.target }} --all-features + just clippy-examples # Run clippy on the host tools clippy-host: runs-on: ubuntu-24.04 needs: setup - strategy: - matrix: - rust: ${{ fromJSON(needs.setup.outputs.rust-versions) }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | - rustup install ${{ matrix.rust }} - rustup default ${{ matrix.rust }} + rustup toolchain install 1.92 + rustup default 1.92 rustup component add clippy - name: Clippy run: | - cd arm-targets - cargo clippy + just clippy-host # Gather all the above clippy jobs together for the purposes of getting an overall pass-fail clippy-all: runs-on: ubuntu-24.04 - needs: [clippy, clippy-host] + needs: [clippy, clippy-examples, clippy-host] steps: - run: /bin/true @@ -245,13 +238,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install rust + - name: Install Just + uses: taiki-e/install-action@just + - name: Install Rust run: | rustup install stable rustup default stable - - name: Run cargo test - run: | - cargo test --manifest-path aarch32-cpu/Cargo.toml + - run: | + just test-cargo # Run some programs in QEMU 9 # These tests build with nightly as pinned by the rust-toolchain.toml file, because they include Tier 3 targets @@ -261,6 +255,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Just + uses: taiki-e/install-action@just - name: Install Dependencies run: | sudo apt-get -y update @@ -271,7 +267,7 @@ jobs: - name: Run tests in QEMU run: | export PATH=/opt/qemu/bin:$PATH - ./tests.sh + just test-qemu # Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail all: diff --git a/.gitignore b/.gitignore index a9d37c5..75337a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ target +examples/mps3-an536/target +examples/mps3-an536/target-d32 +examples/versatileab/target +examples/versatileab/target-d32 Cargo.lock diff --git a/arm-targets/Cargo.toml b/arm-targets/Cargo.toml index 8cef727..3143926 100644 --- a/arm-targets/Cargo.toml +++ b/arm-targets/Cargo.toml @@ -11,7 +11,7 @@ name = "arm-targets" readme = "README.md" repository = "https://github.com/rust-embedded/aarch32.git" homepage = "https://github.com/rust-embedded/aarch32" -rust-version = "1.59" +rust-version = "1.83" version = "0.4.0" [dependencies] diff --git a/arm-targets/README.md b/arm-targets/README.md index 7ed05a2..0d19ced 100644 --- a/arm-targets/README.md +++ b/arm-targets/README.md @@ -29,7 +29,7 @@ This allows you to write Rust code in your firmware like: ## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.59.0 and up, as recorded +This crate is guaranteed to compile on stable Rust 1.83.0 and up, as recorded by the `package.rust-version` property in `Cargo.toml`. Increasing the MSRV is not considered a breaking change and may occur in a diff --git a/examples/mps3-an536/src/bin/smp_test.rs b/examples/mps3-an536/src/bin/smp_test.rs index 37d1dd1..e4d8c46 100644 --- a/examples/mps3-an536/src/bin/smp_test.rs +++ b/examples/mps3-an536/src/bin/smp_test.rs @@ -102,11 +102,13 @@ fn main() -> ! { aarch32_cpu::asm::nop(); } + let mut code = 0; let total_a = SHARED_VARIABLE.load(Ordering::Relaxed); if total_a == CAS_LOOPS * 2 { println!("CAS test passed"); } else { println!("CAS test failed, got {} not 2000", total_a); + code = 1; } let total_b = critical_section::with(|cs| { @@ -118,9 +120,10 @@ fn main() -> ! { println!("CS Mutex test passed"); } else { println!("CS Mutex test failed, got {} not 2000", total_b); + code = 1; } - semihosting::process::exit(0); + semihosting::process::exit(code); } /// The entry-point to the Rust application. diff --git a/justfile b/justfile new file mode 100644 index 0000000..768dc30 --- /dev/null +++ b/justfile @@ -0,0 +1,153 @@ +# The rust-embedded/aarch32 Just file +# +# You need to install `just` from https://github.com/casey/just to use +# this file + +# We only need this for some targets but we set it globally to avoid +# dependencies like proc-macro2 from being rebuilt +export RUSTC_BOOTSTRAP := "1" + + +# If you run with `just v=1` then we make cargo run in verbose mode +v := "0" +verbose := if v == "1" { "--verbose" } else { "" } + +# Our default target. It does everything that you might want to do pre-checkin. +check: build-all build-all-examples fmt-check clippy-examples clippy-targets clippy-host test + +# Cleans up all the target folders +clean: + # The cross-compiled workspace + cargo clean + # The host-compiled helper library + cd arm-targets && cargo clean + # The cross-compiled examples + cd examples/versatileab && cargo clean + cd examples/mps3-an536 && cargo clean + +# Builds our workspace for all targets +build-all: \ + build-arm-targets \ + (build-tier3-no-atomics "armv4t-none-eabi") \ + (build-tier3-no-atomics "thumbv4t-none-eabi") \ + (build-tier3-no-atomics "armv5te-none-eabi") \ + (build-tier3-no-atomics "thumbv5te-none-eabi") \ + (build-tier2 "armv7r-none-eabi") \ + (build-tier2 "armv7r-none-eabihf") \ + (build-tier2 "armv7a-none-eabi") \ + (build-tier2 "armv7a-none-eabihf") \ + (build-tier2 "armv8r-none-eabihf") \ + +# Build the arm-targets library +build-arm-targets: + cd arm-targets && cargo build {{verbose}} + +# Builds our workspace with various features, building core from source +build-tier3-no-atomics target: + cargo build --target {{target}} -Zbuild-std=core {{verbose}} + cargo build --target {{target}} -Zbuild-std=core --features "serde, defmt, critical-section-single-core, check-asm" {{verbose}} + +# Builds our workspace with various features +build-tier2 target: + cargo build --target {{target}} {{verbose}} + cargo build --target {{target}} --features "serde, defmt, critical-section-multi-core, check-asm" {{verbose}} + cargo build --target {{target}} --features "serde, defmt, critical-section-single-core, check-asm" {{verbose}} + +# Builds our examples for each target, which also builds our cross-compiled workspace +build-all-examples: \ + (build-versatileab-tier3 "armv4t-none-eabi") \ + (build-versatileab-tier3 "thumbv4t-none-eabi") \ + (build-versatileab-tier3 "armv5te-none-eabi") \ + (build-versatileab-tier3 "thumbv5te-none-eabi") \ + (build-versatileab-tier2 "armv7r-none-eabi") \ + (build-versatileab-tier2 "armv7r-none-eabihf") \ + (build-versatileab-tier2 "armv7a-none-eabi") \ + (build-versatileab-tier2 "armv7a-none-eabihf") \ + (build-mps3-tier2 "armv8r-none-eabihf") \ + +# Builds the Versatile AB examples, building core from source +build-versatileab-tier3 target: + cd examples/versatileab && cargo build --target={{target}} -Zbuild-std=core {{verbose}} + +# Builds the Versatile AB examples, assuming core has been prebuilt +build-versatileab-tier2 target: + cd examples/versatileab && cargo build --target={{target}} {{verbose}} + +# Builds the MPS3-AN536 examples, assuming core has been prebuilt +build-mps3-tier2 target: + cd examples/mps3-an536 && cargo build --target={{target}} {{verbose}} + +# Formats all the code +fmt: + # The cross-compiled workspace + cargo fmt {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo fmt {{verbose}} + # The cross-compiled examples cargo fmt + cd examples/versatileab && cargo fmt {{verbose}} + cd examples/mps3-an536 && cargo fmt {{verbose}} + +# Checks all the code is formatted +fmt-check: + # The cross-compiled workspace + cargo fmt --check + # The host-compiled helper library + cd arm-targets && cargo fmt --check {{verbose}} + # The cross-compiled examples cargo fmt + cd examples/versatileab && cargo fmt --check {{verbose}} + cd examples/mps3-an536 && cargo fmt --check {{verbose}} + +# Checks all the cross-compiled workspace passes the clippy lints +clippy-targets: \ + (clippy-target "armv7r-none-eabi") \ + (clippy-target "armv7r-none-eabihf") \ + (clippy-target "armv7a-none-eabi") \ + (clippy-target "armv7a-none-eabihf") \ + (clippy-target "armv8r-none-eabihf") \ + +# Checks all the cross-compiled workspace passes the clippy lints +clippy-target target: + cargo clippy --target={{target}} {{verbose}} + +# Checks the examples pass the clippy lints +clippy-examples: + cd examples/versatileab && cargo clippy --target=armv7r-none-eabi {{verbose}} + cd examples/mps3-an536 && cargo clippy --target=armv8r-none-eabihf {{verbose}} + +# Checks the host code passes the clippy lints +clippy-host: + # The cross-compiled workspace + cargo clippy {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo clippy {{verbose}} + +# Run all the tests +test: test-cargo test-qemu test-smp + +# Run the unit tests with cargo +test-cargo: + # The cross-compiled workspace + cargo test {{verbose}} + # The host-compiled helper library + cd arm-targets && cargo test {{verbose}} + +# Run the integration tests in QEMU +test-qemu: + ./tests.sh examples/versatileab armv4t-none-eabi -Zbuild-std=core {{verbose}} + ./tests.sh examples/versatileab thumbv4t-none-eabi -Zbuild-std=core {{verbose}} + ./tests.sh examples/versatileab armv5te-none-eabi -Zbuild-std=core {{verbose}} + ./tests.sh examples/versatileab thumbv5te-none-eabi -Zbuild-std=core {{verbose}} + ./tests.sh examples/versatileab armv7r-none-eabi {{verbose}} + ./tests.sh examples/versatileab armv7r-none-eabihf {{verbose}} + ./tests.sh examples/versatileab armv7a-none-eabi {{verbose}} + ./tests.sh examples/versatileab armv7a-none-eabihf {{verbose}} + RUSTFLAGS=-Ctarget-feature=+d32 ./tests.sh examples/versatileab armv7a-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} + ./tests.sh examples/mps3-an536 armv8r-none-eabihf {{verbose}} + RUSTFLAGS=-Ctarget-cpu=cortex-r52 ./tests.sh examples/mps3-an536 armv8r-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} + +# Run the special SMP test +# +# You can't run the normal examples with two CPUs because nothing stops the second CPU from running :/. So we have +# a special test for SMP mode on the MPS3-AN536 +test-smp: + cd examples/mps3-an536 && cargo run --target=armv8r-none-eabihf --bin smp_test {{verbose}} -- --smp 2 diff --git a/tests.sh b/tests.sh index 7700e4b..eb92aa9 100755 --- a/tests.sh +++ b/tests.sh @@ -38,38 +38,20 @@ my_diff() { fi } -run_tests() { - directory=$1 - target="$2" - flags=$3 - echo "Running directory=$directory target=$target flags=$flags" - pushd $directory - cargo build --target=$target $flags || exit 1 - for bin_path in src/bin/*.rs; do - filename=$(basename $bin_path) - binary=${filename%.rs} - cargo run --target=$target --bin $binary $flags > ./target/$binary-$target.out - my_diff ./reference/$binary-$target.out ./target/$binary-$target.out || fail $binary $target - done - popd -} - -run_tests examples/versatileab armv7r-none-eabi "" -run_tests examples/versatileab armv7r-none-eabihf "" -run_tests examples/versatileab armv7a-none-eabi "" -run_tests examples/versatileab armv7a-none-eabihf "" -RUSTFLAGS="-Ctarget-feature=+d32" run_tests examples/versatileab armv7a-none-eabihf "--features=fpu-d32" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab armv5te-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab armv4t-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab thumbv5te-none-eabi "-Zbuild-std=core" -RUSTC_BOOTSTRAP=1 run_tests examples/versatileab thumbv4t-none-eabi "-Zbuild-std=core" -run_tests examples/mps3-an536 armv8r-none-eabihf "" -RUSTFLAGS="-Ctarget-cpu=cortex-r52" run_tests examples/mps3-an536 armv8r-none-eabihf "--features=fpu-d32" - -# Special case the SMP test. You can't run the normal examples with two CPUs because nothing stops the second CPU from running :/ -pushd examples/mps3-an536 -cargo run --target=armv8r-none-eabihf --bin smp_test -- --smp 2 > ./target/smp_test-armv8r-none-eabihf_smp2.out -my_diff ./reference/smp_test-armv8r-none-eabihf_smp2.out ./target/smp_test-armv8r-none-eabihf_smp2.out || fail smp_test armv8r-none-eabihf +directory=$1 +shift +target=$1 +shift +flags="$*" +echo "Running directory=$directory target=$target flags=$flags" +pushd $directory +cargo build --target=$target $flags || exit 1 +for bin_path in src/bin/*.rs; do + filename=$(basename $bin_path) + binary=${filename%.rs} + cargo run --target=$target --bin $binary $flags > ./target/$binary-$target.out + my_diff ./reference/$binary-$target.out ./target/$binary-$target.out || fail $binary $target +done popd if [ "$FAILURE" == "1" ]; then From a2e6902a558ad011a1d19c6b6ee9cb7d50139ae5 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Thu, 1 Jan 2026 16:19:51 +0000 Subject: [PATCH 2/6] Fix code example We missed this because we weren't testing examples --- aarch32-rt/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aarch32-rt/src/lib.rs b/aarch32-rt/src/lib.rs index 7f653b4..f7c6048 100644 --- a/aarch32-rt/src/lib.rs +++ b/aarch32-rt/src/lib.rs @@ -274,7 +274,7 @@ //! use aarch32_rt::exception; //! //! #[exception(PrefetchAbort)] -//! fn my_handler(addr: usize) -> usize { +//! unsafe fn my_handler(addr: usize) -> usize { //! // do stuff, then go back to the instruction after the one that failed //! addr + 4 //! } From ea500e02f00c54b2cd008e8102f0212dc3c35d4f Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Thu, 1 Jan 2026 16:27:06 +0000 Subject: [PATCH 3/6] Fix some clippy lints --- arm-targets/src/lib.rs | 7 +------ arm-targets/src/main.rs | 2 +- examples/mps3-an536/src/bin/registers.rs | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arm-targets/src/lib.rs b/arm-targets/src/lib.rs index 259e4e5..bd71463 100644 --- a/arm-targets/src/lib.rs +++ b/arm-targets/src/lib.rs @@ -347,12 +347,7 @@ pub enum Abi { impl Abi { /// Decode a target string pub fn get(target: &str) -> Option { - if Arch::get(target).is_none() { - // Don't give an ABI for non-Arm targets - // - // e.g. PowerPC also has an ABI called EABI, but it's not the same - return None; - } + let _ = Arch::get(target)?; if target.ends_with("eabi") { Some(Abi::Eabi) } else if target.ends_with("eabihf") { diff --git a/arm-targets/src/main.rs b/arm-targets/src/main.rs index c1824ba..cfa259e 100644 --- a/arm-targets/src/main.rs +++ b/arm-targets/src/main.rs @@ -2,7 +2,7 @@ /// Entry point to the program fn main() { - if let Some(target) = std::env::args().skip(1).next() { + if let Some(target) = std::env::args().nth(1) { println!("// These are the features for the target '{}'", target); arm_targets::process_target(&target); } else { diff --git a/examples/mps3-an536/src/bin/registers.rs b/examples/mps3-an536/src/bin/registers.rs index ba989fe..a38b630 100644 --- a/examples/mps3-an536/src/bin/registers.rs +++ b/examples/mps3-an536/src/bin/registers.rs @@ -111,6 +111,7 @@ fn mpu_pmsa_v8() { } // Load a config (but don't enable it) + #[allow(clippy::zero_ptr)] mpu.configure(&El1Config { background_config: true, regions: &[El1Region { From ca796e2c94b7e95349d5c5f89212fa8960bad742 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Fri, 2 Jan 2026 20:25:15 +0000 Subject: [PATCH 4/6] Switch to latest nightly Rust. Now has thumb interworking on all {arm,thumb}*-none-eabi* targets. --- examples/mps3-an536/rust-toolchain.toml | 2 +- examples/versatileab/rust-toolchain.toml | 2 +- examples/versatileab/src/bin/svc-a32.rs | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/mps3-an536/rust-toolchain.toml b/examples/mps3-an536/rust-toolchain.toml index a0744b5..24a0e1e 100644 --- a/examples/mps3-an536/rust-toolchain.toml +++ b/examples/mps3-an536/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "stable" +channel = "nightly-2026-01-02" targets = [ "armv8r-none-eabihf", ] diff --git a/examples/versatileab/rust-toolchain.toml b/examples/versatileab/rust-toolchain.toml index 6cfcef0..a19e4d9 100644 --- a/examples/versatileab/rust-toolchain.toml +++ b/examples/versatileab/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "stable" +channel = "nightly-2026-01-02" targets = [ "armv7r-none-eabi", "armv7r-none-eabihf", diff --git a/examples/versatileab/src/bin/svc-a32.rs b/examples/versatileab/src/bin/svc-a32.rs index 3a24519..48eac26 100644 --- a/examples/versatileab/src/bin/svc-a32.rs +++ b/examples/versatileab/src/bin/svc-a32.rs @@ -32,18 +32,12 @@ fn svc_handler(arg: u32) { } } -#[cfg_attr( - any(arm_architecture = "v4t", arm_architecture = "v5te"), - instruction_set(arm::a32) -)] +#[instruction_set(arm::a32)] fn do_svc1() { aarch32_cpu::svc!(0xABCDEF); } -#[cfg_attr( - any(arm_architecture = "v4t", arm_architecture = "v5te"), - instruction_set(arm::a32) -)] +#[instruction_set(arm::a32)] fn do_svc2() { aarch32_cpu::svc!(0x456789); } From 17743994bd98506f3143509b93a6e804d1743d42 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Fri, 2 Jan 2026 21:13:42 +0000 Subject: [PATCH 5/6] Don't fail early when running QEMU tests --- justfile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/justfile b/justfile index 768dc30..faedb26 100644 --- a/justfile +++ b/justfile @@ -133,17 +133,20 @@ test-cargo: # Run the integration tests in QEMU test-qemu: - ./tests.sh examples/versatileab armv4t-none-eabi -Zbuild-std=core {{verbose}} - ./tests.sh examples/versatileab thumbv4t-none-eabi -Zbuild-std=core {{verbose}} - ./tests.sh examples/versatileab armv5te-none-eabi -Zbuild-std=core {{verbose}} - ./tests.sh examples/versatileab thumbv5te-none-eabi -Zbuild-std=core {{verbose}} - ./tests.sh examples/versatileab armv7r-none-eabi {{verbose}} - ./tests.sh examples/versatileab armv7r-none-eabihf {{verbose}} - ./tests.sh examples/versatileab armv7a-none-eabi {{verbose}} - ./tests.sh examples/versatileab armv7a-none-eabihf {{verbose}} - RUSTFLAGS=-Ctarget-feature=+d32 ./tests.sh examples/versatileab armv7a-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} - ./tests.sh examples/mps3-an536 armv8r-none-eabihf {{verbose}} - RUSTFLAGS=-Ctarget-cpu=cortex-r52 ./tests.sh examples/mps3-an536 armv8r-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} + #!/bin/sh + FAIL=0 + ./tests.sh examples/versatileab armv4t-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv4t-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv5te-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab thumbv5te-none-eabi -Zbuild-std=core {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7r-none-eabi {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7r-none-eabihf {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7a-none-eabi {{verbose}} || FAIL=1 + ./tests.sh examples/versatileab armv7a-none-eabihf {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-feature=+d32 ./tests.sh examples/versatileab armv7a-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + ./tests.sh examples/mps3-an536 armv8r-none-eabihf {{verbose}} || FAIL=1 + RUSTFLAGS=-Ctarget-cpu=cortex-r52 ./tests.sh examples/mps3-an536 armv8r-none-eabihf --features=fpu-d32 --target-dir=target-d32 {{verbose}} || FAIL=1 + if [ "${FAIL}" == "1" ]; then exit 1; fi # Run the special SMP test # From a88e95b08df10b51eb225c107ab889ae975c240b Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Fri, 2 Jan 2026 21:17:35 +0000 Subject: [PATCH 6/6] Need extra components. --- examples/mps3-an536/rust-toolchain.toml | 1 + examples/versatileab/rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/mps3-an536/rust-toolchain.toml b/examples/mps3-an536/rust-toolchain.toml index 24a0e1e..92667db 100644 --- a/examples/mps3-an536/rust-toolchain.toml +++ b/examples/mps3-an536/rust-toolchain.toml @@ -3,3 +3,4 @@ channel = "nightly-2026-01-02" targets = [ "armv8r-none-eabihf", ] +components = ["rust-src", "clippy", "rustfmt"] diff --git a/examples/versatileab/rust-toolchain.toml b/examples/versatileab/rust-toolchain.toml index a19e4d9..cf1e917 100644 --- a/examples/versatileab/rust-toolchain.toml +++ b/examples/versatileab/rust-toolchain.toml @@ -6,4 +6,4 @@ targets = [ "armv7a-none-eabi", "armv7a-none-eabihf", ] -components = ["rust-src"] +components = ["rust-src", "clippy", "rustfmt"]