From c94bd2d98d29cbf6d92f2f915e72d1555e282248 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 23 Dec 2017 21:34:24 +0100 Subject: [PATCH 1/4] add a Cargo feature, cm7-r0p1, to fix a Cortex-M7 BASEPRI erratum --- Cargo.toml | 5 ++++- ci/script.sh | 9 ++++++++- src/lib.rs | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05f90ab000..e506be02b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/japaric/cortex-m-rtfm" version = "0.3.0" [dependencies] -cortex-m = { git = "https://github.com/japaric/cortex-m" } +cortex-m = { git = "https://github.com/japaric/cortex-m", branch = "cm7-r0p1" } untagged-option = "0.1.1" # rtfm-core = "0.2.0" rtfm-core = { git = "https://github.com/japaric/rtfm-core" } @@ -32,5 +32,8 @@ features = ["rt"] git = "https://github.com/japaric/stm32f103xx" # version = "0.8.0" +[features] +cm7-r0p1 = ["cortex-m/cm7-r0p1"] + [profile.release] lto = true diff --git a/ci/script.sh b/ci/script.sh index af425da52f..222a1e0263 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -7,7 +7,14 @@ main() { return fi - xargo build --target $TARGET + case $TARGET in + thumbv7em-none-eabi*) + xargo check --target $TARGET --features cm7-r0p1 + xargo check --target $TARGET --features cm7-r0p1 --examples + ;; + esac + + xargo check --target $TARGET xargo check --target $TARGET --examples } diff --git a/src/lib.rs b/src/lib.rs index be670490e7..986a7c9ad2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,11 @@ //! //! [here]: https://docs.rs/cortex-m-rtfm-macros/0.2.0/cortex_m_rtfm_macros/fn.app.html //! +//! # Important: Cortex-M7 devices +//! +//! If targeting a Cortex-M7 device with revision r0p1 then you MUST enable the `cm7-r0p1` Cargo +//! feature of this crate or the `Resource.claim` and `Resource.claim_mut` methods WILL misbehave. +//! //! # Examples //! //! In increasing grade of complexity. See the [examples](./examples/index.html) From 2249985e8179b50e98254459663a49a3b63e6a36 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 11 Jan 2018 15:46:27 +0100 Subject: [PATCH 2/4] use master branch of cortex-m --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e506be02b6..641c3aa298 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/japaric/cortex-m-rtfm" version = "0.3.0" [dependencies] -cortex-m = { git = "https://github.com/japaric/cortex-m", branch = "cm7-r0p1" } +cortex-m = { git = "https://github.com/japaric/cortex-m" } untagged-option = "0.1.1" # rtfm-core = "0.2.0" rtfm-core = { git = "https://github.com/japaric/rtfm-core" } From 6e3b9a30fd9816963813d505265b6b0fcc8951c7 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 11 Jan 2018 15:46:38 +0100 Subject: [PATCH 3/4] switch to a stable release of compiletest_rs --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 641c3aa298..5af50671d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,8 +20,7 @@ rtfm-core = { git = "https://github.com/japaric/rtfm-core" } cortex-m-rtfm-macros = { path = "macros" } [target.'cfg(target_arch = "x86_64")'.dev-dependencies] -# compiletest_rs = "0.3.4" -compiletest_rs = { git = "https://github.com/dwrensha/compiletest-rs", branch = "rustup" } +compiletest_rs = "0.3.8" [dev-dependencies.cortex-m-rt] features = ["abort-on-panic"] From f695bdb7e9dab1af3964ddabccf9c738dd46d774 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 11 Jan 2018 16:03:41 +0100 Subject: [PATCH 4/4] fix the compiletest_rs version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5af50671d3..bf123dd00a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ rtfm-core = { git = "https://github.com/japaric/rtfm-core" } cortex-m-rtfm-macros = { path = "macros" } [target.'cfg(target_arch = "x86_64")'.dev-dependencies] -compiletest_rs = "0.3.8" +compiletest_rs = "0.3.5" [dev-dependencies.cortex-m-rt] features = ["abort-on-panic"]