Skip to content

Commit 64e858d

Browse files
committed
add example for STM32F4 chips
note that this is not part of the main `Cargo.toml` as it has to build against a different target, which isn't supported if they are in the same workspace.
1 parent fc0b7bc commit 64e858d

File tree

10 files changed

+817
-4
lines changed

10 files changed

+817
-4
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ updates:
88
directory: "/"
99
schedule:
1010
interval: "weekly"
11+
- package-ecosystem: "cargo"
12+
directory: "/examples/stm32f4-single-motor-example"
13+
schedule:
14+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
CARGO_TERM_COLOR: always
1010

1111
jobs:
12-
build:
12+
lib:
1313
strategy:
1414
fail-fast: false
1515
matrix:
@@ -35,3 +35,31 @@ jobs:
3535
run: cargo clippy ${{ matrix.features }}
3636
- name: audit
3737
run: cargo audit
38+
39+
stm32f4-single-motor-example:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- name: install rust toolchain
44+
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
targets: thumbv7em-none-eabihf
47+
components: rustfmt clippy
48+
- name: Install flip-link
49+
run: cargo install flip-link
50+
- name: build
51+
run: cargo build
52+
working-directory: examples/stm32f4-single-motor-example
53+
- name: check
54+
run: cargo check
55+
working-directory: examples/stm32f4-single-motor-example
56+
# no tests available for now => no test step as it'd fail otherwise
57+
- name: check formatting
58+
run: cargo fmt --all -- --check
59+
working-directory: examples/stm32f4-single-motor-example
60+
- name: clippy
61+
run: cargo clippy
62+
working-directory: examples/stm32f4-single-motor-example
63+
- name: audit
64+
run: cargo audit
65+
working-directory: examples/stm32f4-single-motor-example

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/target
1+
**/target
22
/Cargo.lock
33

4-
.idea
5-
.vscode
4+
**/.idea
5+
**/.vscode

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ See the documentation for usage examples.
2323
## Optional features
2424
* `defmt`: you can enable the [`defmt`](https://defmt.ferrous-systems.com/) feature to get a `defmt::debug!` call for every speed change.
2525

26+
## Examples
27+
An simple example for the STM32F4 microcontrollers is [available](examples/stm32f4-single-motor-example/README.md).
28+
2629
## Changelog
2730
For the changelog please see the dedicated [CHANGELOG.md](CHANGELOG.md).
2831

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[target.thumbv7em-none-eabihf]
2+
runner = 'probe-run --chip STM32F401RE'
3+
rustflags = [
4+
"-C", "link-arg=-Tlink.x",
5+
"-C", "link-arg=-Tdefmt.x",
6+
"-C", "linker=flip-link",
7+
]
8+
9+
[build]
10+
target = "thumbv7em-none-eabihf"
11+
12+
[env]
13+
DEFMT_LOG = "info"

0 commit comments

Comments
 (0)