Skip to content

Commit ae3a846

Browse files
Merge pull request #43 from datdenkikniet/39-41-42
Merge of PRs #39 #41 and #42, update versions of stm32f7xx-hal and stm32f4xx-hal, convert CI to github actions
2 parents 284079d + bfa9746 commit ae3a846

File tree

17 files changed

+931
-335
lines changed

17 files changed

+931
-335
lines changed

.cargo/config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ rustflags = [
44
"-C", "link-arg=-Tlink.x",
55
]
66

7+
[target.thumbv7m-none-eabi]
8+
runner = 'gdb'
9+
rustflags = [
10+
"-C", "link-arg=-Tlink.x",
11+
]
12+
713
[build]
814
# Pick ONE of these compilation targets
915
# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+

.github/workflows/build.yml

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
- trying
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
# Run cargo fmt --check, includes macros/
15+
style:
16+
name: style
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Install Rust
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
profile: minimal
26+
toolchain: stable
27+
override: true
28+
components: rustfmt
29+
30+
- name: cargo fmt --check
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: fmt
34+
args: --all -- --check
35+
36+
# Run cargo test
37+
test:
38+
name: test
39+
strategy:
40+
matrix:
41+
target:
42+
- x86_64-unknown-linux-gnu
43+
toolchain:
44+
- stable
45+
features:
46+
- stm32f745,smi
47+
runs-on: ubuntu-20.04
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
52+
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
53+
uses: actions-rs/toolchain@v1
54+
with:
55+
toolchain: ${{ matrix.toolchain }}
56+
target: ${{ matrix.target }}
57+
override: true
58+
59+
- name: cargo test the documentation and readme
60+
uses: actions-rs/cargo@v1
61+
with:
62+
command: test
63+
args: --target=${{ matrix.target }} --features ${{ matrix.features }}
64+
65+
66+
# Compilation
67+
build:
68+
name: build
69+
runs-on: ubuntu-20.04
70+
strategy:
71+
matrix:
72+
target:
73+
- x86_64-unknown-linux-gnu
74+
toolchain:
75+
- stable
76+
features:
77+
- stm32f107,smi
78+
- stm32f407,smi
79+
- stm32f417,smi
80+
- stm32f427,smi
81+
- stm32f429,smi
82+
- stm32f437,smi
83+
- stm32f439,smi
84+
- stm32f469,smi
85+
- stm32f479,smi
86+
- stm32f429,smi
87+
- stm32f745,smi
88+
- stm32f746,smi
89+
- stm32f756,smi
90+
- stm32f765,smi
91+
- stm32f767,smi
92+
- stm32f769,smi
93+
- stm32f777,smi
94+
- stm32f778,smi
95+
- stm32f779,smi
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v3
99+
100+
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
101+
uses: actions-rs/toolchain@v1
102+
with:
103+
toolchain: ${{ matrix.toolchain }}
104+
target: ${{ matrix.target }}
105+
override: true
106+
107+
- name: cargo build
108+
uses: actions-rs/cargo@v1
109+
with:
110+
use-cross: false
111+
command: build
112+
args: --target=${{ matrix.target }} --features ${{ matrix.features }}
113+
114+
# Examples
115+
examples:
116+
name: examples
117+
runs-on: ubuntu-20.04
118+
strategy:
119+
matrix:
120+
target:
121+
- thumbv7m-none-eabi
122+
toolchain:
123+
- stable
124+
steps:
125+
- name: Checkout
126+
uses: actions/checkout@v3
127+
128+
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
129+
uses: actions-rs/toolchain@v1
130+
with:
131+
toolchain: ${{ matrix.toolchain }}
132+
target: ${{ matrix.target }}
133+
override: true
134+
135+
- name: cargo build f4 example pktgen
136+
uses: actions-rs/cargo@v1
137+
with:
138+
use-cross: false
139+
command: build
140+
args: --target=${{ matrix.target }} --example pktgen --features stm32f429,smi
141+
142+
- name: cargo build f4 example ip
143+
uses: actions-rs/cargo@v1
144+
with:
145+
use-cross: false
146+
command: build
147+
args: --target=${{ matrix.target }} --example ip --features stm32f429,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
148+
149+
- name: cargo build f4 example arp
150+
uses: actions-rs/cargo@v1
151+
with:
152+
use-cross: false
153+
command: build
154+
args: --target=${{ matrix.target }} --example arp --features stm32f407,smi
155+
156+
- name: cargo build f4 example arp-smoltcp
157+
uses: actions-rs/cargo@v1
158+
with:
159+
use-cross: false
160+
command: build
161+
args: --target=${{ matrix.target }} --example arp-smoltcp --features stm32f407,smi,smoltcp-phy,smoltcp/socket-icmp
162+
163+
- name: cargo build f1 example ip
164+
uses: actions-rs/cargo@v1
165+
with:
166+
use-cross: false
167+
command: build
168+
args: --target=${{ matrix.target }} --example ip-f107 --features stm32f107,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
169+
170+
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
171+
#
172+
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
173+
174+
ci-success:
175+
name: ci
176+
if: github.event_name == 'push' && success()
177+
needs:
178+
- style
179+
- build
180+
- test
181+
- examples
182+
runs-on: ubuntu-20.04
183+
steps:
184+
- name: Mark the job as a success
185+
run: exit 0

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

Cargo.toml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "stm32-eth"
44
description = "Embedded Rust Ethernet driver for the STM32 MCU series"
55
license = "Apache-2.0"
66
authors = ["Astro <astro@spaceboyz.net>"]
7-
version = "0.2.0"
7+
version = "0.3.0"
88
keywords = ["ethernet", "eth", "stm32", "stm32f4", "stm32f7"]
99
repository = "https://github.com/stm32-rs/stm32-eth"
1010
documentation = "https://docs.rs/stm32-eth/"
@@ -15,13 +15,14 @@ travis-ci = { repository = "astro/stm32-eth", branch = "master" }
1515
maintenance = { status = "experimental" }
1616

1717
[package.metadata.docs.rs]
18-
features = [ "smi", "smoltcp-phy", "stm32f429", "smoltcp/socket-tcp" ]
18+
features = ["smi", "smoltcp-phy", "stm32f429", "smoltcp/socket-tcp"]
1919

2020
[dependencies]
2121
volatile-register = "0.2"
2222
aligned = "0.4"
23-
stm32f7xx-hal = {git = "https://github.com/stm32-rs/stm32f7xx-hal", rev = "d632a5c", optional = true}
24-
stm32f4xx-hal = {version = "0.10", optional = true}
23+
stm32f7xx-hal = { version = "0.7.0", optional = true }
24+
stm32f4xx-hal = { version = "0.13", optional = true }
25+
stm32f1xx-hal = { version = "0.9", optional = true }
2526
cortex-m = "0.7"
2627
log = { version = "0.4", optional = true }
2728

@@ -36,6 +37,8 @@ device-selected = []
3637
fence = []
3738
smi = []
3839

40+
stm32f107 = ["stm32f1xx-hal/stm32f107", "device-selected"]
41+
3942
stm32f407 = ["stm32f4xx-hal/stm32f407", "device-selected"]
4043
stm32f417 = ["stm32f4xx-hal/stm32f417", "device-selected"]
4144
stm32f427 = ["stm32f4xx-hal/stm32f427", "device-selected"]
@@ -59,10 +62,10 @@ smoltcp-phy = ["smoltcp"]
5962

6063
[dev-dependencies]
6164
cortex-m = "0.7"
62-
cortex-m-rt = ">=0.6.15, <0.8"
65+
cortex-m-rt = "0.7"
6366
panic-itm = "0.4"
64-
cortex-m-semihosting = "0.3.5"
65-
stm32f4xx-hal = {version = "0.10.1", features = ["rt"] }
67+
cortex-m-semihosting = "0.3"
68+
fugit = "0.3"
6669

6770
[[example]]
6871
name = "pktgen"
@@ -75,6 +78,13 @@ required-features = [
7578
"smoltcp/log", "smoltcp/verbose"
7679
]
7780

81+
[[example]]
82+
name = "ip-f107"
83+
required-features = [
84+
"stm32f107", "smoltcp-phy", "log", "smoltcp/socket-tcp", "smoltcp/socket-icmp",
85+
"smoltcp/log", "smoltcp/verbose"
86+
]
87+
7888
[[example]]
7989
name = "arp"
8090
required-features = ["stm32f407", "smi"]

0 commit comments

Comments
 (0)