Switched to probe-run
This commit is contained in:
parent
b2f80a8da2
commit
9653df09b6
|
@ -1,9 +1,9 @@
|
|||
[target.thumbv7m-none-eabi]
|
||||
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
|
||||
rustflags = [
|
||||
"-C", "linker=rust-lld",
|
||||
"-C", "link-arg=-Tlink.x",
|
||||
]
|
||||
runner = "probe-run --chip STM32F103CB"
|
||||
|
||||
[build]
|
||||
target = "thumbv7m-none-eabi"
|
||||
|
|
|
@ -11,6 +11,7 @@ cortex-m-rt = "0.6"
|
|||
stm32f1xx-hal = { version = "0.5.3", features = ["stm32f103", "stm32-usbd", "rt"] }
|
||||
panic-semihosting = "0.5"
|
||||
embedded-hal = "0.2.3"
|
||||
rtt-target = {version = "0.2.2", features = ["cortex-m"]}
|
||||
|
||||
|
||||
# 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_main]
|
||||
|
||||
|
||||
extern crate panic_semihosting;
|
||||
|
||||
|
||||
use stm32f1xx_hal::{
|
||||
prelude::*,
|
||||
pac,
|
||||
delay::Delay,
|
||||
};
|
||||
use cortex_m_rt::entry;
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use rtt_target::{rprintln, rtt_init_print};
|
||||
use stm32f1xx_hal::{delay::Delay, pac, prelude::*};
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
rtt_init_print!();
|
||||
|
||||
// Get access to the core peripherals from the cortex-m crate
|
||||
let cp = cortex_m::Peripherals::take().unwrap();
|
||||
// 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.
|
||||
let mut led = gpioc.pc13.into_push_pull_output(&mut gpioc.crh);
|
||||
|
||||
|
||||
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 {
|
||||
rprintln!("blink");
|
||||
led.set_high().unwrap();
|
||||
delay.delay_ms(1000u16);
|
||||
rprintln!("blonk");
|
||||
led.set_low().unwrap();
|
||||
delay.delay_ms(1000u16);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue