Skip to content
Snippets Groups Projects
Commit 95ac0286 authored by Per's avatar Per
Browse files

condintonal breakpoints

parent ee25bd0e
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,23 @@ ...@@ -38,6 +38,23 @@
], ],
"cwd": "${workspaceRoot}" "cwd": "${workspaceRoot}"
}, },
{
"type": "gdb",
"request": "attach",
"name": "Release nested",
"gdbpath": "/usr/bin/arm-none-eabi-gdb",
"executable": "./target/thumbv7em-none-eabihf/release/examples/nested",
"target": ":3333",
"remote": true,
"autorun": [
"monitor reset init",
"monitor arm semihosting enable",
"monitor tpiu config internal /tmp/itm.log uart off 16000000",
"monitor itm port 0 on",
"load"
],
"cwd": "${workspaceRoot}"
},
{ {
"type": "gdb", "type": "gdb",
"request": "attach", "request": "attach",
......
...@@ -27,6 +27,30 @@ ...@@ -27,6 +27,30 @@
"$rustc" "$rustc"
] ]
}, },
{
"label": "xargo build --example nested --features wcet_bkpt",
"type": "shell",
"command": "xargo build --features \"wcet_bkpt\" --example nested ",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$rustc"
]
},
{
"label": "xargo build --release --example nested --features wcet_bkpt",
"type": "shell",
"command": "xargo build --release --features \"wcet_bkpt\" --example nested",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$rustc"
]
},
{ {
"label": "xargo build --example preemption", "label": "xargo build --example preemption",
"type": "shell", "type": "shell",
......
...@@ -30,5 +30,9 @@ git = "https://gitlab.henriktjader.com/pln/STM32F40x" ...@@ -30,5 +30,9 @@ git = "https://gitlab.henriktjader.com/pln/STM32F40x"
features = ["rt"] features = ["rt"]
version = "0.1.0" version = "0.1.0"
[features]
wcet_bkpt = []
[profile.release] [profile.release]
lto = true lto = true
debug = true
...@@ -43,6 +43,7 @@ app! { ...@@ -43,6 +43,7 @@ app! {
fn init(_p: init::Peripherals, _r: init::Resources) {} fn init(_p: init::Peripherals, _r: init::Resources) {}
#[inline(never)]
fn idle() -> ! { fn idle() -> ! {
// A // A
rtfm::bkpt(); rtfm::bkpt();
...@@ -59,6 +60,7 @@ fn idle() -> ! { ...@@ -59,6 +60,7 @@ fn idle() -> ! {
} }
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[inline(never)]
fn exti0( fn exti0(
t: &mut Threshold, t: &mut Threshold,
EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resources, EXTI0::Resources { mut LOW, mut HIGH }: EXTI0::Resources,
...@@ -116,13 +118,18 @@ fn exti0( ...@@ -116,13 +118,18 @@ fn exti0(
// Once again the preemption threshold drops but this time to 1. Now the // Once again the preemption threshold drops but this time to 1. Now the
// pending `exti1` task can preempt this task // pending `exti1` task can preempt this task
// ~> exti1 // ~> exti1
// K
rtfm::bkpt();
} }
#[inline(never)]
fn exti1(_t: &mut Threshold, _r: EXTI1::Resources) { fn exti1(_t: &mut Threshold, _r: EXTI1::Resources) {
// C, I // C, J
rtfm::bkpt(); rtfm::bkpt();
} }
#[inline(never)]
fn exti2(_t: &mut Threshold, _r: EXTI2::Resources) { fn exti2(_t: &mut Threshold, _r: EXTI2::Resources) {
// E, H // E, H
rtfm::bkpt(); rtfm::bkpt();
......
...@@ -85,7 +85,7 @@ extern crate untagged_option; ...@@ -85,7 +85,7 @@ extern crate untagged_option;
use core::u8; use core::u8;
pub use rtfm_core::{Resource, Static, Threshold}; pub use rtfm_core::{Resource, Static, Threshold};
pub use cortex_m::asm::{bkpt, wfi}; pub use cortex_m::asm::{bkpt, nop, wfi};
pub use cortex_m_rtfm_macros::app; pub use cortex_m_rtfm_macros::app;
#[doc(hidden)] #[doc(hidden)]
pub use untagged_option::UntaggedOption; pub use untagged_option::UntaggedOption;
...@@ -140,7 +140,11 @@ where ...@@ -140,7 +140,11 @@ where
let old = basepri::read(); let old = basepri::read();
let hw = (max_priority - ceiling) << (8 - _nvic_prio_bits); let hw = (max_priority - ceiling) << (8 - _nvic_prio_bits);
basepri::write(hw); basepri::write(hw);
if cfg!(feature = "wcet_bkpt") {bkpt();} else {nop();}
let ret = f(data, &mut Threshold::new(ceiling)); let ret = f(data, &mut Threshold::new(ceiling));
if cfg!(feature = "wcet_bkpt") {bkpt();} else {nop();}
basepri::write(old); basepri::write(old);
ret ret
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment