Skip to content

Commit f5a8721

Browse files
authored
Merge pull request #74 from rust-embedded/fix-73
Update instructions for device example, closes #73
2 parents 77e6080 + d018974 commit f5a8721

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ panic-halt = "0.2.0"
1818
# alloc-cortex-m = "0.3.5"
1919

2020
# Uncomment for the device example.
21+
# Update `memory.x`, set target to `thumbv7em-none-eabihf` in `.cargo/config`,
22+
# and then use `cargo build --examples device` to build it.
2123
# [dependencies.stm32f3]
2224
# features = ["stm32f303", "rt"]
2325
# version = "0.7.1"

examples/device.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@
55
//!
66
//! [`svd2rust`]: https://crates.io/crates/svd2rust
77
//!
8-
//! This example depends on the [`stm32f103xx`] crate so you'll have to add it to your Cargo.toml.
8+
//! This example depends on the [`stm32f3`] crate so you'll have to
9+
//! uncomment it in your Cargo.toml.
910
//!
10-
//! [`stm32f103xx`]: https://crates.io/crates/stm32f103xx
11+
//! [`stm32f3`]: https://crates.io/crates/stm32f3
1112
//!
1213
//! ```
1314
//! $ edit Cargo.toml && tail $_
14-
//! [dependencies.stm32f103xx]
15-
//! features = ["rt"]
16-
//! version = "0.10.0"
15+
//! [dependencies.stm32f3]
16+
//! features = ["stm32f303", "rt"]
17+
//! version = "0.7.1"
1718
//! ```
1819
//!
20+
//! You also need to set the build target to thumbv7em-none-eabihf,
21+
//! typically by editing `.cargo/config` and uncommenting the relevant target line.
22+
//!
1923
//! ---
2024
2125
#![no_main]
@@ -27,7 +31,7 @@ extern crate panic_halt;
2731
use cortex_m::peripheral::syst::SystClkSource;
2832
use cortex_m_rt::entry;
2933
use cortex_m_semihosting::hprint;
30-
use stm32f30x::{interrupt, Interrupt, NVIC};
34+
use stm32f3::stm32f303::{interrupt, Interrupt, NVIC};
3135

3236
#[entry]
3337
fn main() -> ! {

0 commit comments

Comments
 (0)