Skip to content

Commit 825fd47

Browse files
authored
Merge pull request #54 from datdenkikniet/fix_broken
Fix incorrect startup sequence
2 parents abc1a7f + e691702 commit 825fd47

File tree

9 files changed

+607
-64
lines changed

9 files changed

+607
-64
lines changed

.cargo/config

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
[target.thumbv7em-none-eabihf]
2-
runner = 'gdb'
1+
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2+
runner = 'probe-run'
33
rustflags = [
44
"-C", "link-arg=-Tlink.x",
5+
"-C", "link-arg=-Tdefmt.x",
56
]
67

7-
[target.thumbv7m-none-eabi]
8-
runner = 'gdb'
9-
rustflags = [
10-
"-C", "link-arg=-Tlink.x",
11-
]
128

139
[build]
1410
# Pick ONE of these compilation targets
1511
# target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+
16-
# target = "thumbv7m-none-eabi" # Cortex-M3
12+
target = "thumbv7m-none-eabi" # Cortex-M3
1713
# target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU)
18-
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
14+
# target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)

.github/workflows/build.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,35 +137,67 @@ jobs:
137137
with:
138138
use-cross: false
139139
command: build
140-
args: --target=${{ matrix.target }} --example pktgen --features stm32f429
140+
args: --release --target=${{ matrix.target }} --example pktgen --features stm32f429
141141

142142
- name: cargo build f4 example ip
143143
uses: actions-rs/cargo@v1
144144
with:
145145
use-cross: false
146146
command: build
147-
args: --target=${{ matrix.target }} --example ip --features stm32f429,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
147+
args: --release --target=${{ matrix.target }} --example ip --features stm32f429,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
148148

149149
- name: cargo build f4 example arp
150150
uses: actions-rs/cargo@v1
151151
with:
152152
use-cross: false
153153
command: build
154-
args: --target=${{ matrix.target }} --example arp --features stm32f407
154+
args: --release --target=${{ matrix.target }} --example arp --features stm32f407
155155

156156
- name: cargo build f4 example arp-smoltcp
157157
uses: actions-rs/cargo@v1
158158
with:
159159
use-cross: false
160160
command: build
161-
args: --target=${{ matrix.target }} --example arp-smoltcp --features stm32f407,smoltcp-phy,smoltcp/socket-icmp
161+
args: --release --target=${{ matrix.target }} --example arp-smoltcp --features stm32f407,smoltcp-phy,smoltcp/socket-icmp
162162

163163
- name: cargo build f1 example ip
164164
uses: actions-rs/cargo@v1
165165
with:
166166
use-cross: false
167167
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
168+
args: --release --target=${{ matrix.target }} --example ip-f107 --features stm32f107,smoltcp-phy,log,smoltcp/socket-tcp,smoltcp/socket-icmp,smoltcp/log,smoltcp/verbose
169+
170+
rtic-echo-example:
171+
name: rtic-echo example
172+
runs-on: ubuntu-20.04
173+
strategy:
174+
matrix:
175+
target:
176+
- thumbv7m-none-eabi
177+
toolchain:
178+
- stable
179+
features:
180+
- stm32f107
181+
- stm32f407
182+
- stm32f765
183+
- rtic-echo-example-altpin,stm32f765
184+
steps:
185+
- name: Checkout
186+
uses: actions/checkout@v3
187+
188+
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }})
189+
uses: actions-rs/toolchain@v1
190+
with:
191+
toolchain: ${{ matrix.toolchain }}
192+
target: ${{ matrix.target }}
193+
override: true
194+
195+
- name: build rtic-echo-example with features ${{ matrix.features }}
196+
uses: actions-rs/cargo@v1
197+
with:
198+
use-cross: false
199+
command: build
200+
args: --release --target=${{ matrix.target }} --example rtic-echo --features rtic-echo-example,${{ matrix.features }}
169201

170202
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
171203
#
@@ -179,6 +211,7 @@ jobs:
179211
- build
180212
- test
181213
- examples
214+
- rtic-echo-example
182215
runs-on: ubuntu-20.04
183216
steps:
184217
- name: Mark the job as a success

Cargo.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,22 @@ ieee802_3_miim = { version = "0.7", optional = true }
2727
cortex-m = "0.7"
2828
log = { version = "0.4", optional = true }
2929

30+
# For rtic-echo
31+
cortex-m-rtic = { version = "1.0", optional = true }
32+
defmt = { version = "0.3", optional = true }
33+
defmt-rtt = { version = "0.3", optional = true }
34+
panic-probe = { version = "0.3", optional = true, features = [ "print-defmt" ] }
35+
systick-monotonic = { version = "1.0", optional = true }
36+
fugit = { version = "0.3", optional = true}
37+
3038
[dependencies.smoltcp]
3139
version = "0.8"
3240
default-features = false
3341
features = ["medium-ethernet", "proto-ipv4"]
3442
optional = true
3543

3644
[features]
37-
default = [ "ieee802_3_miim" ]
45+
default = [ "ieee802_3_miim", "defmt" ]
3846
device-selected = []
3947
fence = []
4048

@@ -61,6 +69,10 @@ stm32f779 = ["stm32f7xx-hal/stm32f779", "device-selected", "fence"]
6169

6270
smoltcp-phy = ["smoltcp"]
6371

72+
# Example features
73+
rtic-echo-example = [ "ieee802_3_miim", "cortex-m-rtic", "smoltcp-phy", "smoltcp/defmt", "smoltcp/medium-ethernet", "smoltcp/socket-tcp", "defmt", "defmt-rtt", "panic-probe", "systick-monotonic", "fugit" ]
74+
rtic-echo-example-altpin = [ ]
75+
6476
[dev-dependencies]
6577
cortex-m = "0.7"
6678
cortex-m-rt = "0.7"
@@ -94,6 +106,10 @@ required-features = ["stm32f407"]
94106
name = "arp-smoltcp"
95107
required-features = ["stm32f407", "smoltcp-phy", "smoltcp/socket-icmp"]
96108

109+
[[example]]
110+
name = "rtic-echo"
111+
required-features = [ "rtic-echo-example" ]
112+
97113
[profile.release]
98114
debug = 2
99115
lto = true

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
#[cfg(feature = "stm32f1xx-hal")]
3+
println!("cargo:rustc-link-search=memory.x")
4+
}

0 commit comments

Comments
 (0)