Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add thumbv7em-none-eabihf for cortex-m floating point processors #625

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ ENV CARGO_HOME=/usr/local/cargo \
RUN rustup set profile minimal \
&& rustup default ${RUST_VERSION} \
&& rustup component add clippy llvm-tools rustfmt \
&& rustup target add thumbv7em-none-eabi
&& rustup target add thumbv7em-none-eabi \
&& rustup target add thumbv7em-none-eabihf

# Install bats
RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/rust/test/cortex-mf/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "thumbv7em-none-eabihf"
257 changes: 257 additions & 0 deletions .devcontainer/rust/test/cortex-mf/Cargo.lock
richardapeters marked this conversation as resolved.
Show resolved Hide resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .devcontainer/rust/test/cortex-mf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "hello-cortex"
version = "0.1.0"
edition = "2021"

[dependencies]
cortex-m = "0.6.0"
cortex-m-rt = "0.6.10"
panic-halt = "0.2.0"
15 changes: 15 additions & 0 deletions .devcontainer/rust/test/cortex-mf/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#![no_std]
#![no_main]

use panic_halt as _;

use cortex_m::asm;
use cortex_m_rt::entry;

#[entry]
fn main() -> ! {
asm::nop();

loop {
}
}
13 changes: 13 additions & 0 deletions .devcontainer/rust/test/testsuite.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ teardown() {
popd
}

@test "valid code input should result in working elf executable targeting the cortex-mf architecture" {
pushd cortex-mf

cargo build

run cargo readobj --bin hello-cortex -- --file-headers
assert_output --partial "Class: ELF32"
assert_output --partial "Type: EXEC"
assert_output --partial "Machine: ARM"

popd
}

@test "using cargo run should result in working executable" {
pushd cargo

Expand Down
Loading