Skip to content

Commit 10d0f2d

Browse files
author
Marcel Maage
committed
unification of all examples
1 parent 78a467a commit 10d0f2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4077
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stm32f1_rust_can
2-
Short example for usage of can with cortex-m-rtic 1.0.0 and stm32f1xx-hal 0.9.0
2+
Short example for usage of can with cortex-m-rtic and embassy
33

44
Example for handling and flashing stm32f1 can be found at https://jonathanklimt.de/electronics/programming/embedded-rust/rust-on-stm32-2/.
55
cargo build --release
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2+
runner = "probe-rs run --chip STM32F103C8"
3+
#runner = 'gdb-multiarch'
4+
# runner = "gdb-multiarch -q -x openocd.gdb"
5+
#runner = "arm-none-eabi-gdb -q -x openocd.gdb"
6+
7+
[build]
8+
#target = "thumbv7em-none-eabihf"
9+
target = "thumbv7m-none-eabi"
10+
11+
rustflags = [
12+
# use the Tlink.x scrip from the cortex-m-rt crate
13+
"-C", "link-arg=-Tlink.x",
14+
"-C", "link-arg=-Tdefmt.x",
15+
]
16+
17+
[env]
18+
DEFMT_LOG = "info"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{
2-
"rust-analyzer.checkOnSave.allTargets": false
1+
{
2+
"rust-analyzer.checkOnSave.allTargets": false
33
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
// Defines the Visual Studio Code Tasks for building and debugging.
3+
// See https://go.microsoft.com/fwlink/?LinkId=733558
4+
// for the documentation about the tasks.json format
5+
"version": "2.0.0",
6+
"tasks": [
7+
{
8+
// Connect to the Blue Pill via OpenOCD, to be used for debugging.
9+
"label": "🔗 Connect To STM32 Blue Pill",
10+
"type": "shell",
11+
"windows": {
12+
"command": "c:\\openocd\\bin\\openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg",
13+
},
14+
"linux": {
15+
"command": "openocd -f interface/stlink-v2.cfg -f ./stm32f1x.cfg",
16+
},
17+
"problemMatcher": []
18+
},
19+
{
20+
// Build the Rust main program. This is the default task for "Run Build Task".
21+
// The compiled main program will be located at "embassy-stm32-example/target/thumbv7m-none-eabi/release/embassy-stm32-example"
22+
"label": "🔨 Build (STM32 Blue Pill Rust)",
23+
"type": "shell",
24+
"command": "cargo build --release",
25+
"group": {
26+
"kind": "build",
27+
"isDefault": true
28+
}
29+
},
30+
{
31+
// Remove all compiled files, including compiled examples.
32+
"label": "🗑️ Remove Build (STM32 Blue Pill Rust)",
33+
"type": "shell",
34+
"command": "cargo clean",
35+
"problemMatcher": []
36+
},
37+
{
38+
// Check that the main program and its dependencies are valid.
39+
"label": "✔️ Check Build (STM32 Blue Pill Rust)",
40+
"type": "shell",
41+
"command": "cargo check --release",
42+
"problemMatcher": []
43+
},
44+
{
45+
// Expand the Rust macros for the example code but do not build. Used for troubleshooting the macros. The active window must be the example source file.
46+
"label": "🗳️ Expand Example (STM32 Blue Pill Rust)",
47+
"type": "shell",
48+
"command": "cargo rustc -vv --release --profile=check -- -Zunstable-options --pretty=expanded",
49+
"problemMatcher": []
50+
},
51+
]
52+
}

0 commit comments

Comments
 (0)