From 95d88b8b8d3089a2e0e5b09fdc5076be7318dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 20:25:00 +0200 Subject: [PATCH 01/13] add travis-ci and bors config None of this will succeed until #5 is resolved. Stable builds will only succeed once #6 is resolved. --- .github/bors.toml | 3 +++ .travis.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/bors.toml create mode 100644 .travis.yml diff --git a/.github/bors.toml b/.github/bors.toml new file mode 100644 index 00000000..9f02861e --- /dev/null +++ b/.github/bors.toml @@ -0,0 +1,3 @@ +block_labels = [ "S-blocked" ] +delete_merged_branches = true +status = [ "continuous-integration/travis-ci/push" ] diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..8f79fa56 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +language: rust + +rust: + - stable + - beta + - nightly + +cache: cargo + +branches: + only: + - staging + - trying + - master + +before_script: + - rustup target add thumbv7em-none-eabihf + +env: +- MCU=stm32h742 +- MCU=stm32h743 +- MCU=stm32h753 +- MCU=stm32h750 + +matrix: + allow_failures: + - rust: nightly + fast_finish: true + +script: + - RUSTFLAGS="-D warnings" cargo build --release --examples --features rt,$MCU + +notifications: + email: false From c21a088897f15f6cfd2e28090e45e535a3e92978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 20:54:59 +0200 Subject: [PATCH 02/13] travis: use local stm32-rs and fail stable/beta This matches the currently targeted dependencies/rust versions. It should be removed once #5 and #6 are resolved. --- .github/force-pac-master.sh | 17 +++++++++++++++++ .travis.yml | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 .github/force-pac-master.sh diff --git a/.github/force-pac-master.sh b/.github/force-pac-master.sh new file mode 100755 index 00000000..6ccf7abc --- /dev/null +++ b/.github/force-pac-master.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +git clone https://github.com/stm32-rs/stm32-rs +cd stm32-rs +cargo install svd2rust +rustup component add rustfmt +pip install --user pyyaml +cd svd +./extract.sh +cd .. +make patch +make -j$(nproc) svd2rust +cd .. + +sed -i 's|/your/path/here/||' Cargo.toml diff --git a/.travis.yml b/.travis.yml index 8f79fa56..2255bb27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ branches: before_script: - rustup target add thumbv7em-none-eabihf + - ./github/force-pac-master.sh env: - MCU=stm32h742 @@ -24,7 +25,8 @@ env: matrix: allow_failures: - - rust: nightly + - rust: stable + - rust: beta fast_finish: true script: From e82fd301bb4366540f49da20f2118119d6430cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 20:59:30 +0200 Subject: [PATCH 03/13] travis: fix c21a088897 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2255bb27..29c05b89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ branches: before_script: - rustup target add thumbv7em-none-eabihf - - ./github/force-pac-master.sh + - ./.github/force-pac-master.sh env: - MCU=stm32h742 From 283c4b312eeee04c1e3bb33b61a948dc762ccd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 21:08:58 +0200 Subject: [PATCH 04/13] travis: tweak local pac crate installation --- .github/force-pac-master.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/force-pac-master.sh b/.github/force-pac-master.sh index 6ccf7abc..941f6687 100755 --- a/.github/force-pac-master.sh +++ b/.github/force-pac-master.sh @@ -5,13 +5,14 @@ set -e git clone https://github.com/stm32-rs/stm32-rs cd stm32-rs cargo install svd2rust +# cargo install form # not needed here rustup component add rustfmt -pip install --user pyyaml +pip3 install --user pyyaml cd svd ./extract.sh cd .. -make patch -make -j$(nproc) svd2rust +make patch CRATES=stm32h7 +make -j$(nproc) svd2rust CRATES=stm32h7 cd .. sed -i 's|/your/path/here/||' Cargo.toml From e60ad4a6c16ce2fc1c362222fb343fe54ee4c92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 21:16:36 +0200 Subject: [PATCH 05/13] travis: no point in trying stable and beta --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 29c05b89..77e8d3cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: rust rust: - - stable - - beta - nightly +# - beta +# - stable cache: cargo @@ -25,8 +25,7 @@ env: matrix: allow_failures: - - rust: stable - - rust: beta +# - rust: nightly fast_finish: true script: From f98ce5a1275e6789c5aaa842357afb9aef943263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 21:25:14 +0200 Subject: [PATCH 06/13] travis: force svd2rust --- .github/force-pac-master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/force-pac-master.sh b/.github/force-pac-master.sh index 941f6687..522fc50f 100755 --- a/.github/force-pac-master.sh +++ b/.github/force-pac-master.sh @@ -4,7 +4,7 @@ set -e git clone https://github.com/stm32-rs/stm32-rs cd stm32-rs -cargo install svd2rust +cargo install --force svd2rust # cargo install form # not needed here rustup component add rustfmt pip3 install --user pyyaml From 096d8d4b3151764009ad1bbd134a9939e73eb58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 3 Jul 2019 21:28:58 +0200 Subject: [PATCH 07/13] travis: pyyaml is installed --- .github/force-pac-master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/force-pac-master.sh b/.github/force-pac-master.sh index 522fc50f..b0b70405 100755 --- a/.github/force-pac-master.sh +++ b/.github/force-pac-master.sh @@ -7,7 +7,7 @@ cd stm32-rs cargo install --force svd2rust # cargo install form # not needed here rustup component add rustfmt -pip3 install --user pyyaml +# pip install --user pyyaml # already installed cd svd ./extract.sh cd .. From 754fc43f482cde5fba7f715e5d128cdde7fc2988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 08:39:01 +0200 Subject: [PATCH 08/13] Cargo.toml: add myself to authors --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 68e029eb..6f2704de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ version = "0.1.0" authors = ["Andrew Straw ", "Richard Meadows ", "Henrik Böving ", - "Jan Adä "] + "Jan Adä ", + "Robert Jördens "] edition = "2018" categories = ["embedded", "hardware-support", "no-std"] description = "Peripheral access API for STM32H7 series microcontrollers" From 7990bab95eab4df0449f85a7dbc8abb587c39fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 08:39:54 +0200 Subject: [PATCH 09/13] rcc: unreachable vos pattern --- src/rcc.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rcc.rs b/src/rcc.rs index cc6462d6..25be73b5 100644 --- a/src/rcc.rs +++ b/src/rcc.rs @@ -492,7 +492,6 @@ impl Rcc { 180..=224 => (4, 2), _ => (7, 3), }, - _ => (7, 3), }; let flash = unsafe { &(*FLASH::ptr()) }; From 611355c7ae3c0965bec1c09f1b084f6df31bfc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 08:40:19 +0200 Subject: [PATCH 10/13] timer: fix cfg gate --- src/timer.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/timer.rs b/src/timer.rs index e557d9ac..6560ca05 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -157,7 +157,12 @@ macro_rules! hal { } } -#[cfg(any(feature = "stm32h7x3"))] +#[cfg(any( + feature = "stm32h742", + feature = "stm32h743", + feature = "stm32h753", + feature = "stm32h750", +))] hal! { TIM1: (tim1, APB2, tim1en, tim1rst, enr, rstr), TIM2: (tim2, APB1, tim2en, tim2rst, lenr, lrstr), From c5d3e5a75f628926c3bbf96d020b43626bdec811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 08:51:24 +0200 Subject: [PATCH 11/13] type_alias_enum_variants stabilized in 1.37.0 --- examples/adc.rs | 1 - src/lib.rs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/adc.rs b/examples/adc.rs index 9f35bf59..1dd220d1 100644 --- a/examples/adc.rs +++ b/examples/adc.rs @@ -1,7 +1,6 @@ #![deny(unsafe_code)] #![no_main] #![no_std] -#![feature(type_alias_enum_variants)] extern crate panic_itm; diff --git a/src/lib.rs b/src/lib.rs index 870a04a6..67e62bcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(non_camel_case_types)] -#![feature(type_alias_enum_variants)] #[derive(Debug)] pub enum Never {} @@ -64,4 +63,4 @@ pub mod timer; #[cfg(feature = "device-selected")] pub mod watchdog; #[cfg(feature = "device-selected")] -pub mod adc; \ No newline at end of file +pub mod adc; From ebdd3859bb9f84869d436a1ea815e3d8b5958135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 08:52:15 +0200 Subject: [PATCH 12/13] travis: try stable and beta --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77e8d3cb..e3d894ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: rust rust: - nightly -# - beta -# - stable + - beta + - stable cache: cargo @@ -25,7 +25,7 @@ env: matrix: allow_failures: -# - rust: nightly + - rust: nightly fast_finish: true script: From a91afe6f252aa7af4c7419ada670fc310eb4c1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 5 Jul 2019 09:03:33 +0200 Subject: [PATCH 13/13] Revert "travis: try stable and beta" This reverts commit ebdd3859bb9f84869d436a1ea815e3d8b5958135. Once 1.37.0 is beta/stable... --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3d894ea..77e8d3cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: rust rust: - nightly - - beta - - stable +# - beta +# - stable cache: cargo @@ -25,7 +25,7 @@ env: matrix: allow_failures: - - rust: nightly +# - rust: nightly fast_finish: true script: