Skip to content

Commit bb25ff4

Browse files
committed
Bump cortex-m dev-dep to 0.6 (it's only a dev-dep and so doesn't affect other packages)
Disable the semihosting test on thumbv8, as it's currently unsupported in cortex-m-semihosting
1 parent 4a0e534 commit bb25ff4

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

cortex-m-rt/Cargo.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,21 @@ autoexamples = true
1919
r0 = "0.2.2"
2020
cortex-m-rt-macros = { path = "macros", version = "0.1.5" }
2121

22+
[target.thumbv7em-none-eabihf.dev-dependencies]
23+
cortex-m-semihosting = "0.3.1"
24+
25+
[target.thumbv7em-none-eabi.dev-dependencies]
26+
cortex-m-semihosting = "0.3.1"
27+
28+
[target.thumbv7m-none-eabi.dev-dependencies]
29+
cortex-m-semihosting = "0.3.1"
30+
31+
[target.thumbv6m-none-eabi.dev-dependencies]
32+
cortex-m-semihosting = "0.3.1"
33+
2234
[dev-dependencies]
23-
cortex-m = ">= 0.5.7, <0.7"
35+
cortex-m = "0.6"
2436
panic-halt = "0.2.0"
25-
cortex-m-semihosting = "0.3.1"
2637

2738
[dev-dependencies.rand]
2839
default-features = false

cortex-m-rt/examples/qemu.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@
22
#![no_main]
33
#![no_std]
44

5-
extern crate cortex_m;
65

6+
extern crate cortex_m;
77
extern crate cortex_m_rt as rt;
8+
9+
#[cfg(not(armv8m))]
810
extern crate cortex_m_semihosting as semihosting;
11+
912
extern crate panic_halt;
1013

11-
use core::fmt::Write;
1214
use cortex_m::asm;
1315
use rt::entry;
1416

17+
#[cfg(not(armv8m))]
1518
#[entry]
1619
fn main() -> ! {
20+
use core::fmt::Write;
1721
let x = 42;
1822

1923
loop {
2024
asm::nop();
2125

2226
// write something through semihosting interface
2327
let mut hstdout = semihosting::hio::hstdout().unwrap();
24-
write!(hstdout, "x = {}\n", x);
25-
28+
write!(hstdout, "x = {}\n", x).unwrap();
2629
// exit from qemu
2730
semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS);
2831
}
2932
}
33+
34+
#[cfg(armv8m)]
35+
#[entry]
36+
fn main() -> ! {
37+
loop {
38+
asm::nop();
39+
}
40+
}

0 commit comments

Comments
 (0)