diff --git a/.vscode/launch.json b/.vscode/launch.json index a47fdba438cde414e0d8c6006caefadd7b6a59a4..1cc8929a7b0c4bcdb1e63ec7fefd3c92f35f76f4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,7 @@ "executable": "./target/thumbv7em-none-eabihf/debug/app", "configFiles": [ "interface/stlink-v2-1.cfg", - "target/stm32f4x.cfg" + "target/stm32l0.cfg" ], "postLaunchCommands": [ "monitor arm semihosting enable" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c5dc1cfeb28edfcc0b42b4a4b44f2d993738d597..81f15b998710d9bedea87f5f1ccb25e718288536 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -29,8 +29,8 @@ }, { "type": "shell", - "label": "cargo build --example", - "command": "cargo build --example ${fileBasenameNoExtension}", + "label": "cargo build --examples", + "command": "cargo build --example ${fileBasenameNoExtension} --features='rtfm'", "group": { "kind": "build", "isDefault": true diff --git a/Cargo.toml b/Cargo.toml index 11db3ecf2e2eabf5dad0fc8d49713613c28a6449..944eddd2d804601259674629736c498f6101d884 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,13 @@ edition = "2018" [dependencies] panic-halt = "0.2" -panic-semihosting = "0.5" # comment out for `cargo doc` -panic-itm = "0.4.1" # comment out for `cargo doc` +#panic-semihosting = "0.5" # comment out for `cargo doc` +#panic-itm = "0.4.1" # comment out for `cargo doc` cortex-m-semihosting = "0.3.5" aligned = "0.3.2" ufmt = "0.1.0" nb = "0.1.2" -heapless = "0.5.3" +heapless = "0.5.3" [dependencies.cortex-m] version = "0.6.2" diff --git a/examples/bare2.rs b/examples/bare2.rs index 231e3571cf3703def513fcc216eceaa205b1c8a4..4a874d261296ca60a53649072d7d0775733601f4 100644 --- a/examples/bare2.rs +++ b/examples/bare2.rs @@ -34,6 +34,15 @@ fn main() -> ! { let mut dwt = p.DWT; iprintln!(stim, "bare2"); + #[interrupt(priority = 3, resources = [RX, INT])] + fn EXTI0_1() { + resources.INT.clear_irq(resources.RX.pin_number()); + hprintln!("{}", resources.RX.pin_number()).unwrap(); + // spawn.button_event().unwrap(); + + // let mut int = resources.INT; + } + dwt.enable_cycle_counter(); diff --git a/openocd.cfg b/openocd.cfg index b1683242f86378bf0fb66c43b0623e19eaef4b12..498dfe94487eaa65772c58e8cb24097e8d4bc3e4 100644 --- a/openocd.cfg +++ b/openocd.cfg @@ -1,3 +1,4 @@ +# source [find interface/stlink.cfg] source [find interface/stlink-v2-1.cfg] transport select hla_swd @@ -5,6 +6,7 @@ transport select hla_swd # increase working area to 64KB # set WORKAREASIZE 0x10000 +# source [find target/stm32l0.cfg] source [find target/stm32f4x.cfg] # reset_config srst_only