From d018974c6fbb8df9693a65c73c97ac0985fdce1e Mon Sep 17 00:00:00 2001 From: Adam Greig Date: Tue, 23 Jul 2019 20:59:12 -0600 Subject: [PATCH] Update instructions for device example, closes #73 --- Cargo.toml | 2 ++ examples/device.rs | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6e1f63f..09d39a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,8 @@ panic-halt = "0.2.0" # alloc-cortex-m = "0.3.5" # Uncomment for the device example. +# Update `memory.x`, set target to `thumbv7em-none-eabihf` in `.cargo/config`, +# and then use `cargo build --examples device` to build it. # [dependencies.stm32f3] # features = ["stm32f303", "rt"] # version = "0.7.1" diff --git a/examples/device.rs b/examples/device.rs index 6629bde..63c21dc 100644 --- a/examples/device.rs +++ b/examples/device.rs @@ -5,17 +5,21 @@ //! //! [`svd2rust`]: https://crates.io/crates/svd2rust //! -//! This example depends on the [`stm32f103xx`] crate so you'll have to add it to your Cargo.toml. +//! This example depends on the [`stm32f3`] crate so you'll have to +//! uncomment it in your Cargo.toml. //! -//! [`stm32f103xx`]: https://crates.io/crates/stm32f103xx +//! [`stm32f3`]: https://crates.io/crates/stm32f3 //! //! ``` //! $ edit Cargo.toml && tail $_ -//! [dependencies.stm32f103xx] -//! features = ["rt"] -//! version = "0.10.0" +//! [dependencies.stm32f3] +//! features = ["stm32f303", "rt"] +//! version = "0.7.1" //! ``` //! +//! You also need to set the build target to thumbv7em-none-eabihf, +//! typically by editing `.cargo/config` and uncommenting the relevant target line. +//! //! --- #![no_main] @@ -27,7 +31,7 @@ extern crate panic_halt; use cortex_m::peripheral::syst::SystClkSource; use cortex_m_rt::entry; use cortex_m_semihosting::hprint; -use stm32f30x::{interrupt, Interrupt, NVIC}; +use stm32f3::stm32f303::{interrupt, Interrupt, NVIC}; #[entry] fn main() -> ! {