Skip to content

Commit 6a70518

Browse files
committed
main repo structure
1 parent 910e640 commit 6a70518

File tree

15 files changed

+369
-20
lines changed

15 files changed

+369
-20
lines changed

.cargo/config.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[target.thumbv8m.main-none-eabihf]
2+
runner = 'arm-none-eabi-gdb'
3+
rustflags = [
4+
# LLD (shipped with the Rust toolchain) is used as the default linker
5+
"-C", "link-arg=-Tlink.x",
6+
]
7+
8+
[build]
9+
target = "thumbv8m.main-none-eabihf" # Cortex-M33F (with FPU)

.github/bors.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
block_labels = ["wip"]
2+
delete_merged_branches = true
3+
status = [
4+
"Rustfmt",
5+
"ci (1.69.0, stm32h503)",
6+
"ci (1.69.0, stm32h562)",
7+
"ci (1.69.0, stm32h563)",
8+
"ci (1.69.0, stm32h573)",
9+
"ci (stable, stm32h503)",
10+
"ci (stable, stm32h562)",
11+
"ci (stable, stm32h563)",
12+
"ci (stable, stm32h573)",
13+
]

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Continuous integration
7+
8+
jobs:
9+
ci:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix: # All permutations of {rust, mcu}
13+
rust:
14+
- 1.69.0 # MSRV
15+
- stable
16+
mcu:
17+
- stm32h503
18+
- stm32h562
19+
- stm32h563
20+
- stm32h573
21+
env: # Peripheral Feature flags
22+
FLAGS: rt
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Cache cargo registry and index
27+
uses: actions/cache@v2
28+
with:
29+
path: |
30+
~/.cargo/registry
31+
~/.cargo/git
32+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
33+
- name: Cache cargo build
34+
uses: actions/cache@v2
35+
with:
36+
path: target
37+
key: ${{ runner.os }}-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}-memory-${{ hashFiles('**/*.x') }}
38+
- uses: actions-rs/toolchain@v1
39+
with:
40+
profile: minimal
41+
toolchain: ${{ matrix.rust }}
42+
target: thumbv8m.main-none-eabihf
43+
override: true
44+
- uses: actions-rs/cargo@v1
45+
with:
46+
use-cross: true
47+
command: build
48+
args: --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }}
49+
- uses: actions-rs/cargo@v1
50+
with:
51+
command: test
52+
args: --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}

.github/workflows/clippy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
push:
4+
branches: [staging, trying, master]
5+
6+
name: Clippy
7+
8+
jobs:
9+
clippy_check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions-rs/toolchain@v1
14+
with:
15+
components: clippy
16+
toolchain: 1.69.0
17+
target: thumbv8m.main-none-eabihf
18+
override: true
19+
- uses: actions-rs/clippy-check@v1
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
args: --examples --target thumbv8m.main-none-eabihf --features=rt,stm32h503 -- -D warnings

.github/workflows/nightly.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
push:
3+
branches: [ master ] # Do not run on staging / trying
4+
pull_request:
5+
6+
# Checks the crate compiles on nightly rust, and that the logging options for the
7+
# examples compile on nightly
8+
name: Nightly rust examples
9+
10+
jobs:
11+
ci:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
mcu:
16+
- stm32h503
17+
- stm32h562
18+
- stm32h563
19+
- stm32h573
20+
logging: # Example logging options
21+
- log-itm
22+
- log-semihost
23+
- log-rtt
24+
env: # Peripheral Feature flags
25+
FLAGS: rt
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Cache cargo registry and index
30+
uses: actions/cache@v2
31+
with:
32+
path: |
33+
~/.cargo/registry
34+
~/.cargo/git
35+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
36+
- name: Cache cargo build
37+
uses: actions/cache@v2
38+
with:
39+
path: target
40+
key: ${{ runner.os }}-target-nightly-${{ hashFiles('**/Cargo.toml') }}-memory-${{ hashFiles('**/*.x') }}
41+
- uses: actions-rs/toolchain@v1
42+
with:
43+
profile: minimal
44+
toolchain: nightly
45+
target: thumbv8m.main-none-eabihf
46+
override: true
47+
- uses: actions-rs/cargo@v1
48+
with:
49+
use-cross: true
50+
command: build
51+
args: --verbose --release --examples --target thumbv8m.main-none-eabihf --features ${{ matrix.mcu }},${{ env.FLAGS }},${{ matrix.logging }}
52+
- uses: actions-rs/cargo@v1
53+
with:
54+
command: test
55+
args: --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.mcu }},${{ env.FLAGS }}

.github/workflows/rustfmt.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Code formatting check
7+
8+
jobs:
9+
fmt:
10+
name: Rustfmt
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: stable
18+
override: true
19+
- run: rustup component add rustfmt
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: fmt
23+
args: --all -- --check

.github/workflows/version-match.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: Verify rustc versions match
7+
8+
jobs:
9+
fmt:
10+
name: Rustc version match
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v3
15+
- run: node tools/verify-rust-version.js

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
/target
2-
/Cargo.lock
2+
**/*.rs.bk
3+
Cargo.lock
4+
*.hex
5+
*.bin
6+
.gdb_history
7+
Embed.toml
8+
.vscode/*
9+
!.vscode/settings.json

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## [Unreleased]
4+

Cargo.toml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,44 @@ name = "stm32h5xx-hal"
33
version = "0.0.0"
44
edition = "2021"
55
authors = ["Edwin Svensson <[email protected]>"]
6-
homepage = "https://github.com/olback/stm32h5xx-hal"
7-
repository = "https://github.com/olback/stm32h5xx-hal"
6+
homepage = "https://github.com/stm32-rs/stm32h5xx-hal"
7+
repository = "https://github.com/stm32-rs/stm32h5xx-hal"
88
readme = "README.md"
9-
rust-version = "1.65"
9+
rust-version = "1.69.0"
1010
categories = ["embedded", "hardware-support", "no-std"]
1111
description = "Hardware Abstraction Layer implementation for STM32H5 series microcontrollers"
1212
keywords = ["arm", "cortex-m", "stm32h5xx", "hal", "embedded-hal"]
1313
license = "0BSD"
14+
exclude = [".gitignore", "tools/"]
1415

15-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
16+
[package.metadata.docs.rs]
17+
features = ["stm32h503", "rt"]
18+
targets = ["thumbv8m.main-none-eabihf"]
19+
rustdoc-args = ["--cfg", "docsrs"]
20+
21+
[features]
22+
default = ["rt"]
23+
device-selected = []
24+
rm0492 = []
25+
rm0481 = []
26+
rt = ["stm32h5/rt"]
27+
stm32h503 = ["stm32h5/stm32h503", "device-selected", "rm0492"]
28+
stm32h562 = ["stm32h5/stm32h562", "device-selected", "rm0481"]
29+
stm32h563 = ["stm32h5/stm32h563", "device-selected", "rm0481"]
30+
stm32h573 = ["stm32h5/stm32h573", "device-selected", "rm0481"]
31+
# Flags for examples
32+
log-itm = []
33+
log-rtt = []
34+
log-semihost = []
1635

1736
[dependencies]
37+
cortex-m = { version = "^0.7.7", features = ["critical-section-single-core"] }
38+
stm32h5 = "*"
39+
fugit = "0.3.6"
40+
embedded-hal = { version = "0.2.7", features = ["unproven"] }
41+
42+
[profile.release]
43+
codegen-units = 1 # better optimizations
44+
debug = true # symbols are nice and they don't increase the size in flash
45+
lto = true # better optimizations
46+
opt-level = "s" # optimize for binary size

0 commit comments

Comments
 (0)