Skip to content

Commit 1ca0be0

Browse files
committed
Examples build
1 parent 441ecf8 commit 1ca0be0

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ log = { version = "0.4", optional = true }
3030
[features]
3131
smoltcp-phy = ["smoltcp", "log"]
3232
default = []
33-
nucleo-f767zi = ["stm32f7xx-hal", "stm32f7xx-hal/stm32f767"]
34-
nucleo-f429zi = ["stm32f4xx-hal", "stm32f4xx-hal/stm32f429"]
33+
nucleo-f767zi = ["stm32f7xx-hal", "stm32f7xx-hal/stm32f767", "stm32f7xx-hal/rt"]
34+
nucleo-f429zi = ["stm32f4xx-hal", "stm32f4xx-hal/stm32f429", "stm32f4xx-hal/rt"]
3535

3636
[dev-dependencies]
3737
cortex-m = "0.5"
3838
cortex-m-rt = "0.6"
3939
panic-itm = "0.4"
40+
cortex-m-semihosting = "0.3.3"
4041

4142
[[example]]
4243
name = "pktgen"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
Please send pull requests.
1111

12+
## Building Examples
13+
```
14+
cargo build --example="pktgen" --features="nucleo-f767zi"
15+
cargo build --example="ip" --features="nucleo-f767zi" --features="smoltcp-phy"
16+
```
1217

1318
## Usage
1419

examples/ip.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ extern crate panic_itm;
55

66
use cortex_m::asm;
77
use cortex_m_rt::{entry, exception};
8-
use stm32f7xx_hal::{
9-
device::{interrupt, CorePeripherals, Peripherals, SYST},
10-
gpio::GpioExt,
8+
use stm32_eth::{
9+
stm32::{interrupt, CorePeripherals, Peripherals, SYST},
10+
hal::gpio::GpioExt,
1111
};
1212

1313
use core::cell::RefCell;
@@ -80,7 +80,7 @@ fn main() -> ! {
8080
&mut rx_ring[..],
8181
&mut tx_ring[..],
8282
);
83-
eth.enable_interrupt(&mut cp.NVIC);
83+
eth.enable_interrupt();
8484

8585
let local_addr = Ipv4Address::new(10, 0, 0, 1);
8686
let ip_addr = IpCidr::new(IpAddress::from(local_addr), 24);

examples/pktgen.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use cortex_m_rt::{entry, exception};
99

1010
use cortex_m::asm;
1111
use cortex_m::interrupt::Mutex;
12-
use stm32f7xx_hal::{
13-
device::{interrupt, CorePeripherals, Peripherals, SYST},
14-
gpio::GpioExt,
12+
use stm32_eth::{
13+
stm32::{interrupt, CorePeripherals, Peripherals, SYST},
14+
hal::gpio::GpioExt,
1515
};
1616

1717
use core::fmt::Write;
@@ -54,7 +54,7 @@ fn main() -> ! {
5454
&mut rx_ring[..],
5555
&mut tx_ring[..],
5656
);
57-
eth.enable_interrupt(&mut cp.NVIC);
57+
eth.enable_interrupt();
5858

5959
// Main loop
6060
let mut last_stats_time = 0usize;

0 commit comments

Comments
 (0)