Skip to content
Snippets Groups Projects
Commit 9b941828 authored by Per's avatar Per
Browse files

examples

parent 06fdb4a0
No related branches found
No related tags found
No related merge requests found
...@@ -73,15 +73,14 @@ ...@@ -73,15 +73,14 @@
"request": "attach", "request": "attach",
"name": "Debug itm", "name": "Debug itm",
"gdbpath": "/usr/bin/arm-none-eabi-gdb", "gdbpath": "/usr/bin/arm-none-eabi-gdb",
//"executable": "./target/thumbv7em-none-eabihf/debug/nucleo", "executable": "./target/thumbv7em-none-eabihf/debug/examples/itm",
"target": ":3333", "target": ":3333",
"remote": true, "remote": true,
"autorun": [ "autorun": [
"monitor reset init", "monitor reset init",
//"monitor arm semihosting enable", "monitor arm semihosting enable",
"monitor tpiu config internal /tmp/itm.fifo uart off 64000000", "monitor tpiu config internal /tmp/itm.log uart off 16000000 2000000",
//"monitor tpiu config internal /tmp/itm.fifo uart off 16000000", "monitor itm port 0 on",
"file ./target/thumbv7em-none-eabihf/debug/examples/itm",
"load" "load"
], ],
"cwd": "${workspaceRoot}" "cwd": "${workspaceRoot}"
...@@ -101,6 +100,22 @@ ...@@ -101,6 +100,22 @@
"load" "load"
], ],
"cwd": "${workspaceRoot}" "cwd": "${workspaceRoot}"
},
{
"type": "gdb",
"request": "attach",
"name": "Debug panic",
"gdbpath": "/usr/bin/arm-none-eabi-gdb",
//"executable": "./target/thumbv7em-none-eabihf/debug/nucleo",
"target": ":3333",
"remote": true,
"autorun": [
"monitor reset init",
"monitor arm semihosting enable",
"file ./target/thumbv7em-none-eabihf/debug/examples/panic",
"load"
],
"cwd": "${workspaceRoot}"
} }
] ]
} }
\ No newline at end of file
...@@ -74,6 +74,18 @@ ...@@ -74,6 +74,18 @@
"problemMatcher": [ "problemMatcher": [
"$rustc" "$rustc"
] ]
},
{
"taskName": "xargo build --example panic",
"type": "shell",
"command": "xargo build --example panic",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$rustc"
]
} }
] ]
} }
\ No newline at end of file
...@@ -27,6 +27,7 @@ fn main() { ...@@ -27,6 +27,7 @@ fn main() {
let itm = peripheral::ITM.borrow(&cs); let itm = peripheral::ITM.borrow(&cs);
iprintln!(&itm.stim[0], "Hello, world!"); iprintln!(&itm.stim[0], "Hello, world!");
loop {}
}); });
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#![feature(core_intrinsics)] #![feature(core_intrinsics)]
#![feature(lang_items)] #![feature(lang_items)]
#![feature(used)] #![feature(used)]
#![allow(private_no_mangle_fns)]
#![no_std] #![no_std]
extern crate cortex_m; extern crate cortex_m;
...@@ -33,7 +34,7 @@ unsafe extern "C" fn rust_begin_unwind( ...@@ -33,7 +34,7 @@ unsafe extern "C" fn rust_begin_unwind(
args: core::fmt::Arguments, args: core::fmt::Arguments,
file: &'static str, file: &'static str,
line: u32, line: u32,
col: u32, _col: u32,
) -> ! { ) -> ! {
if let Ok(mut stdout) = hio::hstdout() { if let Ok(mut stdout) = hio::hstdout() {
write!(stdout, "panicked at '") write!(stdout, "panicked at '")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment