Switched to probe-run
This commit is contained in:
parent
b2f80a8da2
commit
9653df09b6
|
@ -1,9 +1,9 @@
|
||||||
[target.thumbv7m-none-eabi]
|
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||||
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
|
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-C", "linker=rust-lld",
|
"-C", "linker=rust-lld",
|
||||||
"-C", "link-arg=-Tlink.x",
|
"-C", "link-arg=-Tlink.x",
|
||||||
]
|
]
|
||||||
|
runner = "probe-run --chip STM32F103CB"
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
target = "thumbv7m-none-eabi"
|
target = "thumbv7m-none-eabi"
|
||||||
|
|
|
@ -11,6 +11,7 @@ cortex-m-rt = "0.6"
|
||||||
stm32f1xx-hal = { version = "0.5.3", features = ["stm32f103", "stm32-usbd", "rt"] }
|
stm32f1xx-hal = { version = "0.5.3", features = ["stm32f103", "stm32-usbd", "rt"] }
|
||||||
panic-semihosting = "0.5"
|
panic-semihosting = "0.5"
|
||||||
embedded-hal = "0.2.3"
|
embedded-hal = "0.2.3"
|
||||||
|
rtt-target = {version = "0.2.2", features = ["cortex-m"]}
|
||||||
|
|
||||||
|
|
||||||
# this lets you use `cargo fix`!
|
# this lets you use `cargo fix`!
|
||||||
|
|
11
openocd.gdb
11
openocd.gdb
|
@ -1,11 +0,0 @@
|
||||||
set history save on
|
|
||||||
set confirm off
|
|
||||||
target extended-remote :3333
|
|
||||||
set print asm-demangle on
|
|
||||||
monitor arm semihosting enable
|
|
||||||
monitor reset halt
|
|
||||||
load
|
|
||||||
# monitor verify
|
|
||||||
# monitor reset
|
|
||||||
# quit
|
|
||||||
continue
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg
|
|
16
src/main.rs
16
src/main.rs
|
@ -2,20 +2,17 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
|
|
||||||
extern crate panic_semihosting;
|
extern crate panic_semihosting;
|
||||||
|
|
||||||
|
|
||||||
use stm32f1xx_hal::{
|
|
||||||
prelude::*,
|
|
||||||
pac,
|
|
||||||
delay::Delay,
|
|
||||||
};
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embedded_hal::digital::v2::OutputPin;
|
use embedded_hal::digital::v2::OutputPin;
|
||||||
|
use rtt_target::{rprintln, rtt_init_print};
|
||||||
|
use stm32f1xx_hal::{delay::Delay, pac, prelude::*};
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
rtt_init_print!();
|
||||||
|
|
||||||
// Get access to the core peripherals from the cortex-m crate
|
// Get access to the core peripherals from the cortex-m crate
|
||||||
let cp = cortex_m::Peripherals::take().unwrap();
|
let cp = cortex_m::Peripherals::take().unwrap();
|
||||||
// Get access to the device specific peripherals from the peripheral access crate
|
// Get access to the device specific peripherals from the peripheral access crate
|
||||||
|
@ -37,13 +34,14 @@ fn main() -> ! {
|
||||||
// in order to configure the port. For pins 0-7, crl should be passed instead.
|
// in order to configure the port. For pins 0-7, crl should be passed instead.
|
||||||
let mut led = gpioc.pc13.into_push_pull_output(&mut gpioc.crh);
|
let mut led = gpioc.pc13.into_push_pull_output(&mut gpioc.crh);
|
||||||
|
|
||||||
|
|
||||||
let mut delay = Delay::new(cp.SYST, clocks);
|
let mut delay = Delay::new(cp.SYST, clocks);
|
||||||
|
|
||||||
// Wait for the timer to trigger an update and change the state of the LED
|
// Blink using the delay function
|
||||||
loop {
|
loop {
|
||||||
|
rprintln!("blink");
|
||||||
led.set_high().unwrap();
|
led.set_high().unwrap();
|
||||||
delay.delay_ms(1000u16);
|
delay.delay_ms(1000u16);
|
||||||
|
rprintln!("blonk");
|
||||||
led.set_low().unwrap();
|
led.set_low().unwrap();
|
||||||
delay.delay_ms(1000u16);
|
delay.delay_ms(1000u16);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue