From 78af2bcd4d8d03740201e4f732de6a5f8250f181 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 25 May 2019 08:25:51 -0700 Subject: [PATCH] Update dependencies in Cargo.toml + build instructions I was able to get the blinky example to build and run on a SAML11 Xplained board with these changes. Looks like you were able to upstream the `thumbv8m.base-none-eabi` target definition: https://github.com/rust-lang/rust/pull/55041 I was able to use that via rustup on a recent nightly, so no more need for (patched) xargo. I went ahead and bumped all of the crates to the latest releases as I wasn't able to get anything to compile without doing so. All that said, I was able to blink an LED on a SAML11 Xplained. --- Cargo.toml | 34 +++++++++++++--------------------- README.md | 16 ++++++++++------ thumbv8m.base-none-eabi.json | 27 --------------------------- 3 files changed, 23 insertions(+), 54 deletions(-) delete mode 100644 thumbv8m.base-none-eabi.json diff --git a/Cargo.toml b/Cargo.toml index b100492..6e3db39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,31 +6,23 @@ version = "0.1.0" [dependencies] bare-metal = "0.2.0" vcell = "0.1.0" - -[dependencies.cortex-m] -git = "https://github.com/rust-embedded/cortex-m" -rev = "b70a2179f4e8ee7908b61a6a97970e0cfcf2f313" - -[dependencies.cortex-m-rt] -git = "https://github.com/rust-embedded/cortex-m-rt" -rev = "9cd01176a6a9985c9bc0040801ed593687dd6ab1" -optional = true - -[dev-dependencies.cortex-m-rt] -git = "https://github.com/rust-embedded/cortex-m-rt" -rev = "9cd01176a6a9985c9bc0040801ed593687dd6ab1" - -[dev-dependencies.cortex-m-semihosting] -git = "https://github.com/rust-embedded/cortex-m-semihosting" -rev = "471378bc848172e12e22b9a3b83190747e70bf5c" - -[dev-dependencies.panic-semihosting] -git = "https://github.com/evq/panic-semihosting" -rev = "3d7041af24969f32606e5eb804e23eaac7fb0bfa" +cortex-m = "0.6" +cortex-m-rt = { version = "0.6", optional = true } +cortex-m-semihosting = "0.3" +panic-semihosting = "0.5" [features] +default = ["rt"] rt = ["cortex-m-rt/device"] [profile.release] debug = false lto = true + +[[example]] +name = "blink" +required-features = ["rt"] + +[[example]] +name = "hello" +required-features = ["rt"] diff --git a/README.md b/README.md index a00865e..b98c4a5 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,22 @@ Peripheral access API for SAM L11 microcontrollers # WIP -This crate is a work in progress. Building it either requires -a xargo change or renaming the target spec due to the target -naming convention used. - -https://github.com/japaric/xargo/pull/226 +This crate is a work in progress. ## Usage ### Building the blink example +You'll need a recent Rust `nightly` build. Add the `thumbv8m.base-none-eabi` target: + +``` +$ rustup target add thumbv8m.base-none-eabi +``` + +Then use cargo to build the example: + ``` -RUST_TARGET_PATH=`pwd` xargo build --release --target thumbv8m.base-none-eabi --example blink +$ cargo build --release --example blink ``` ### Programming blink example to FLASH on the SAM L11 XPLAINED dev board diff --git a/thumbv8m.base-none-eabi.json b/thumbv8m.base-none-eabi.json deleted file mode 100644 index c16e4dc..0000000 --- a/thumbv8m.base-none-eabi.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "abi-blacklist": [ - "stdcall", - "fastcall", - "vectorcall", - "thiscall", - "win64", - "sysv64" - ], - "arch": "arm", - "data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", - "emit-debug-gdb-scripts": false, - "env": "", - "executables": true, - "features": "+strict-align", - "linker": "rust-lld", - "linker-flavor": "ld.lld", - "llvm-target": "thumbv8m.base-none-eabi", - "max-atomic-width": 32, - "os": "none", - "panic-strategy": "abort", - "relocation-model": "static", - "target-c-int-width": "32", - "target-endian": "little", - "target-pointer-width": "32", - "vendor": "" -}